Closed PrzemyslawKlys closed 2 years ago
.NET Standard is just a specification for .NET API, not an actual framework.
.Net Standard is not a framework or platform of its own. It does not have implementations or a runtime, it just defines a specification of what different .Net platforms have to implement to remain .Net Standard compliant. For Instance, .Net Core is a framework with a runtime that implements .NetStandard. In other words, .Net Standard defines a set of API’s that the platforms has to implement to be compliant with .Net Standard. By implementing this specification, the base class libraries of different platforms are unified which were otherwise evolving independently though many of the library functions are common. On the other hand, this also means the developers need not learn different Base Class Libraries for learning different platforms.
as per http://www.codedigest.com/quick-start/9/what-is-netstandard
Here's what Microsoft says on it:
When you have .NET Standard 2.0 it actually supports the use of those frameworks
And for .NET 2.1 those:
So when you try to add net standard 2.0/net standard 2.1 it won't really execute. That's why I chose 3.1 for tests.
That's very interesting, I didn't know that. So if you specify say .netstandard2.1
you actually kinda specify all the versions listed in the screenshot above, do I understand that right?
Also, how could I test it to work with those .netstandard
versions when I can't add them to the Test project?
Here's a bit more explanation:
.NET Standard is not itself a runtime it is a type forwarding mechanism for multiple different runtimes. Therefore, it is not possible to create anything but a non-executable class library in .NET Standard, just as was the case with PCLs. This enables the class library to be consumed by executable assemblies that target specific runtimes (.NET Framework, .NET Core, Xamarin.iOS, Mono, etc).
My understanding of it - when you add support for .NET Standard 2.0 or 2.1 you don't need to do the specific implementation for .NET Framework or .NET Core, but simply publish those, and whenever nuget gets downloaded it will work with .NET Standard, if there's no specific .NET implementation - just like for .NET CORE 3.1 which is not added, but works correctly.
The largest coverage is .NET Standard 1.0, but it heavily limits the API. Not sure if your code would be able to support this.
Since I want to use your project in PowerShell 5.1 and PowerShell 7 I need to add support for at least 4.7.2 and .NET Standard 2.0. Had to downgrade some code, and add dependencies