Home > Enterprise >  .NET SupportedOSPlatformAttribute: what values my I validly use?
.NET SupportedOSPlatformAttribute: what values my I validly use?

Time:09-30

I've got this attribute in an AssemblyInfo file. Right now it's set to this:

System.Runtime.Versioning.SupportedOSPlatform("windows7.0")]

As per the docs, the idea at the time was to keep anyone from trying to use the software on anything earlier than windows 7

But I have no memory of where I got the actual literal string "windows7.0". Is there some documented list of valid platforms to use? Do I just say, "windows8.0" for windows 8? "windows10.0" for windows 10? etc? The Microsoft documentation does not seem to give any guidance

CodePudding user response:

In this case it's not just a platform but platform version which seems to be build as simple string concatenation. There are multiple examples in the platform compatibility analyzer article in the docs.

Also AFAIK you should be able to use RIDs (Runtime Identifiers) for this, see more at the docs and in the github repo.

Also OS-specific TFMs (target framework moniker) doc can be useful.

  • Related