Skip to content

Commit

Permalink
[release/6.0] App does not Run as a service in a Windows Container (#…
Browse files Browse the repository at this point in the history
…74188)

* App does not Run as a service in a Windows Container (#62452)

Removing SessionId check in IsWindowsService(). This check is not correct when the process is being run in a Windows container. The container will get a different SessionId.

Fix #52416

* Add 6.0.x servicing changes
  • Loading branch information
eerhardt authored Sep 7, 2022
1 parent 849fe98 commit 84b31e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFrameworks>net461;netstandard2.0;netstandard2.1</TargetFrameworks>
<EnableDefaultItems>true</EnableDefaultItems>
<PackageDescription>.NET hosting infrastructure for Windows Services.</PackageDescription>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static bool IsWindowsService()
{
return false;
}
return parent.SessionId == 0 && string.Equals("services", parent.ProcessName, StringComparison.OrdinalIgnoreCase);
return string.Equals("services", parent.ProcessName, StringComparison.OrdinalIgnoreCase);
}
}
}

0 comments on commit 84b31e8

Please sign in to comment.