Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net Standard or Portable Class Library moving forward?

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 ?

like image 761
DevMonk Avatar asked Apr 03 '17 00:04

DevMonk


People also ask

What is the difference between .NET Standard and PCL portable class libraries?

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.

Is .NET standard going away?

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.

What is the difference between .NET framework core and .NET standard class library project types?

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.

Should I use net standard?

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. .


2 Answers

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.

like image 118
Gigi Avatar answered Oct 01 '22 04:10

Gigi


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.

like image 45
Damien Doumer Avatar answered Oct 01 '22 05:10

Damien Doumer