-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supported OS? #5725
Comments
@Rand-Random I'm not sure I understand. Is the concern merely around the version number?
|
@terrajobst My question is if the suffix further limits the supported Operating Systems or not. |
The Windows suffix does not exclude any versions of Windows that are among the supported list of Windows versions that we document. A few API do not work on Nano Server and will throw at runtime. |
@danmoseley Also I mentioned Nano Server and Windows just as an example what about all the other flavors? And you didn’t comment about my initial question were I asked if the Page https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md should include the limitation. Did have a look and didn’t see an edit that some APIs are excluded for certain Operating Systems. |
I think I understand the concern now. The target framework name (TFM) is a .NET concept. It represents the set of .NET APIs provided by the .NET platform itself. It allows us to have different flavors of .NET where the API set differs. In the past this was a bit of a wild west situation. With .NET Standard we have formalized a common subset of APIs which we have then further formalized into the new TFM syntax of .NET 5. The intent is that We can, in principle, extend the list of TFMs indefinitely. However, it only makes sense for cases where there is a set of .NET APIs that are only available to a particular operating system. We call those bindings; bindings are different from P/invokes because bindings are sometimes wrappers, sometimes hand authored, and sometimes auto generated. They tend to be large which is why we generally don't want to make them available for other platforms by having them throw. Examples for bindings include WPF, WinForms, WinRT APIs such as WinUI, and the Xamarin APIs for iOS & Android. Please note that those are different from the underlying native APIs (such as Win32) -- TFMs don't model those; TFMs model .NET APIs only. Generally speaking, if you want to P/Invoke to Windows and Linux depending where you you run you don't have to target different TFMs. Instead, in your implementation you declare all the P/Invokes across all the operating systems you care about, do a platform check, and then call the appropriate P/Invoke. But if you really want you can also build a NuGet package that provides different binaries, even if there is no TFM. You can do this via runtime identifiers (RIDs). RIDs allow you to provide different implementations based on architecture (e.g. x64 vs x86), OS (e.g. win vs redhat), and even OS version. There are many more RIDs than there are TFMs. However, in order to contain the exploding complexity, there is a huge difference between TFMs and RIDs: a NuGet package cannot vary API surface based on RID. Another way to think about this is: a TFM is used to select which assembly to pass to the compiler whereas a RID controls which assembly gets deployed with the application. Furthermore, a NuGet package cannot differ its dependencies by RID, only by TFM (same rationale). This means while the RIDs can be complex, a given NuGet dependency graph and which assemblies you're compiling against is only governed by the TFM. RIDs only come to play when NuGet determines which files to copy to the application output. So to summarize: .NET supports many platforms which you can find the RID list. We only define TFMs for platform for which .NET is providing a large API surface that doesn't make sense to other platforms. |
@Rand-Random does this answer your question? we can reactivate if not. |
@terrajobst @danmoseley IMHO, I believe it would be better to mention in https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md that this list doesn't mean it is 100% supported but any Operating System could throw on any number of APIs a runtime exception. Maybe it is just me, but when I read this and that operating system is supported I tend to believe everything (100%) will run just fine on those operating systems and not that some APIs are unsupported on runtime level. I am not implying there should be complete list of which API a operating system supports and which it does not, cause when I had a look the provided RID list I believe it could be sheer endless list of APIs and their supported OS. But just maybe a little remark that some APIs are unsupported, and how a developer can verify if the app that was written does support this and that. |
@Rand-Random have you tried this? https://docs.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer |
I would like to ask if the page
https://github.com/dotnet/core/blob/master/release-notes/5.0/5.0-supported-os.md
should also list the supported Operating Systems for the OS specific target frameworks?
https://docs.microsoft.com/en-us/dotnet/standard/frameworks#net-5-os-specific-tfms
Or is it always guaranteed that eg. "net5.0-windows" will run on all Windows plattforms that "net5.0" support, is there no additional limitation?
The text was updated successfully, but these errors were encountered: