I've heard of
All of these were explained to me as "a subset of the full .Net that allows you to target multiple platforms". So my questions are
(My specific situation: I have a library that targets .Net 2.0, .Net 4.5, and UWP. Targeting UWP required creating a new VS project and linking all the existing files, which is a huge pain. Now someone is telling me it doesn't work for PCL, and from the sound of it I have to do it AGAIN for .Net Standard!?)
NET Standard is platform-agnostic, it can run anywhere, on Windows, Mac, Linux and so on. PCLs can also run cross-platform, but they have a more limited reach. PCLs can only target a limited set of platforms.
UWP does NOT run on the . NET Core App runtime like a . NET Console does, if that makes sense.
NET Framework to create Windows desktop and server-based applications. This includes ASP.NET web applications. On the other hand, . NET Core is used to create server applications that run on Windows, Linux and Mac.
ASP.NET Core is a cross-platform, high-performance, open-source framework for building modern, cloud-enabled, Internet-connected apps. With ASP.NET Core, you can: Build web apps and services, Internet of Things (IoT) apps, and mobile backends. Use your favorite development tools on Windows, macOS, and Linux.
I'll answer your second question first:
I have a library that targets .Net 2.0, .Net 4.5, and UWP. Targeting UWP required creating a new VS project and linking all the existing files, which is a huge pain. Now someone is telling me it doesn't work for PCL, and from the sound of it I have to do it AGAIN for .Net Standard!?)
If I want to write a library that's usable to as large an audience as possible, which one (or more than one) of these do I need to use?
Short answer: you should target netstandard
. Use the lowest version that has all the APIs you need. You can use a tool like API Port to check your existing project for compatibility with a given netstandard
version.
Unfortunately, this approach will leave behind older platforms, in your case, .NET 2.0. If maintaining .NET 2.0 support is necessary, then you'll need a separate project (with linked files) to build a separate .NET 2.0 assembly.
On to the details...
What's the difference!?
netstandard
) - this is the new cross-platform BCL API. It's a "standard" in the sense that it's just an API definition and not an implementation. The idea is that you can compile your library to (a version of) this API and it will run on any platform that supports that version.netstandard
(with a few extra bits). It is a cross-platform implementation of that API. It is possible that UIs and other frameworks may build on it, but for now its only sure foothold is acting as the platform of choice for ASP.NET Core. [Side note: for historical reasons, ".NET Core" is completely different than the netcore
NuGet target; when you're in a NuGet context, netcore
means "Windows 8/8.1/10"].netstandard
.netstandard
version; as such, it is much more difficult to support than any other platform. However, it is still used on devices with tight memory constraints.netstandard
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With