I am writing a Portable Class Library(PCL) in my Xamarin platform and expecting to reuse that in UWP and .Net Core platform. So instead of writing as Portable class library (PCL), I should write as Standard Class Library ? So current version of Standard Library with VS2017 is 2.0 ?
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.
There isn't going to be a new version of . NET Standard, but . NET 5 and all future versions will continue to support . NET Standard 2.1 and earlier.
NET Standard is an API specification that defines, for a given version, what Base Class Libraries must be implemented. . NET Core is a managed framework that is optimized for building console, cloud, ASP.NET Core, and UWP applications.
We recommend you target . NET Standard 2.0, unless you need to support an earlier version. Most general-purpose libraries should not need APIs outside of . NET Standard 2.0. .
Use .NET Standard; it is compatible with a wide range of frameworks - see compatibility grid. The current version used by VS2017 is 1.6, but you can target earlier versions of .NET Standard to support earlier versions of various frameworks.
It is preferable to write it in .Net standard, since writing it your library in .Net standard, cause with .Net standard, you will have access to more packages which will be compatible with the library you are writing instead of using PCL, which will allow you to use packages which function only on some specific platforms. to have the finest details about .Net standard and PCL, and how to create a .Net standard library or moving from PCL to .Net standard, follow this awesome tutorial PCL and .Net standard with Xamarin also don't forget to view the Video at the end of the blog post.
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