Skip to content

Asp.Net 6.X app fails to run as a Windows Service in Windows Server Core/Docker container #70751

@amaltinsky

Description

@amaltinsky

Description

As reported before in (#52416, #50020), asp.net fails the IsWindowsService() check on Windows Server Core and in Docker containers. This breaks all asp.net services on these platforms, requiring brittle workarounds.

This issue was fixed in #62452 but unfortunately, the fix (36bf84f) was not back ported to existing dotnet versions, including 6.0 despite being an LTS release that's supposed to be supported for over two more years.

Reproduction Steps

Create an ASP.Net Windows Service and run it in a Docker container.
Check IsWindowsService()

Expected behavior

IsWindowsService() should return true when running as a service

Actual behavior

IsWindowsService() returns false, causing .UseWindowsService() to not configure the app properly.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions