README incorrectly states that .NET 4.6 is the minimum version
RuntimeInformation.IsOSPlatform is called during initialization. As mentioned on this page, this function is only available starting with .NET 4.7.1.
That page also says the API is available in .NET Standard 2.0, which is supported by .NET 4.6.1. In fact, it indicates that the API is supported back to .NET Standard 1.1. So the information there seems inconsistent.
Is that API causing you a problem?
I also noticed that .NET Standard 2.0 is listed on the page; it probably explains why it compiles fine. I'm getting a FileLoadException when the system tries to call RuntimeInformation.IsOSPlatform.
(sorry screenshot was taken on the computer of a user in France, some parts of the exception are in French but should be clear enough!)
We're just going to require .NET 4.7.1 for our app moving forward; this is the first and only report of this problem we had and the customer was still running a vanilla version of Windows 8.
That page also says the API is available in .NET Standard 2.0, which is supported by .NET 4.6.1.
Note that the first version of .NET Framework that fully supports .NET Standard 2.0 (without issues) is .NET Framework 4.7.2. Initially, it was intended that .NET Standard 2.0 libraries can be used also in .NET Framework 4.6.1 projects and higher (as long as they don't use APIs that are not available there, like RuntimeInformation.IsOSPlatform which is available starting with 4.7.1), but it turned out there were some issues with that approach. See also this video for more details.
This is also mentioned in the .NET Standard version table for implementations support:
While NuGet considers .NET Framework 4.6.1 as supporting .NET Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were built for those versions from .NET Framework 4.6.1 projects. For .NET Framework projects that need to use such libraries, we recommend that you upgrade the project to target .NET Framework 4.7.2 or higher.
@bricelam How much do you folks care about net461 vs net472 ?
If I change the docs/README to say 4.7.2 required, would that be fine?
If I change the actual TFMs for .NET Framework builds to net472, would that be fine?
Anybody else who sees this and wants to add an opinion, feel free.
The last guidance I heard on this was:
- NuGet (or MSBuild) was going to start warning when you reference a .NET Standard 2.0 library from a .NET Framework 4.6.1 project.
- If library authors truly want to support .NET Framework 4.6.1, they should cross-compile to it. In other words, don't assume that your .NET Standard 2.0 library will "just work" there.
- Users should upgrade their projects to .NET Framework 4.7.2 if they want to consume .NET Standard 2.0 libraries.
We haven't made (nor have we been asked to make) Microsoft.Data.Sqlite cross-compile to .NET Framwork 4.6.1, so I suppose that implies that we're OK with 4.7.2 being the minimum required version of .NET Framework.
If you do change your targets on SQLitePCLRaw, be sure to test what happens on .NET Framework 4.6.1. I expect it will simply fail to find e_sqlite3.dll, etc. at runtime. You may want to add your own MSBuild target to warn users targeting a version older than 4.7.2.
/cc @ajcvickers @JeremyLikness
For EF Core, we just "changed the README" (https://docs.microsoft.com/ef/core/platforms) but continued to only target .NET Standard 2.0*
* But EF Core 5 will target .NET Standard 2.1