You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a console application is run as a service, it receives a modified default console control handler. This modified handler does not call ExitProcess when processing the CTRL_LOGOFF_EVENT and CTRL_SHUTDOWN_EVENT signals. This allows the service to continue running after the user logs off.
Since CTRL_LOGOFF_EVENT doesn't necessarily terminate a process, we should consider providing a cancelable API for logoff instead of ProcessExit.
Related is this discussion of a cancelable API for SIGTERM: #35990 (comment)
Activity
Dotnet-GitSync-Bot commentedon Aug 21, 2020
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
danmoseley commentedon Aug 21, 2020
Next step: someone draft an API proposal in this format
MojtabaTajik commentedon Apr 8, 2024
@danmoseley I think we can close this one based on this fix, yes?
jkotas commentedon Apr 10, 2024
The
PosixSignalRegistrationAPI does not handleCTRL_LOGOFF_EVENTthat this issue is about.dotnet-policy-service commentedon Jul 23, 2026
Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.