-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
runtime/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/Directory.Build.props
Line 5 in fa28488
<SupportedOSPlatforms>windows</SupportedOSPlatforms> |
This project is windows specific, but it does its own platform checks and no-ops. This enables development on one platform and publishing to another.
The original change was here: https://github.com/dotnet/runtime/pull/53941/files
Some discussion offline with @jeffhandley and @davidfowl:
@jeffhandley said:
I don’t think we have precedent on such a scenario yet. The attributes are meant to take a runtime failure (PNSE) and turn them into a build-time warning/error. My opinion is to two with your “on the other side” argument—if the API no-ops on non-Windows platforms, then I’m not sure the attribute gains anything. The
UseWindowsService()
/UseSystemd()
pairing for local/deployed is nice too.
Any objections to setting the precedent here that we can remove/omit attributes in cases where the API connotes the platform support by name or docs summary, and no-ops on other platforms?
@davidfowl said:
I think this makes the most sense. The API that takes control into their own hands by doing manual platform tests should be able to suppress the warning so that consumers of that library don't get the warning.