First, we will focus on the Portable Class Library (PCL) then we will replace it with .Net Standard.
Portable Class Library (PCL)
PCL is all about sharing the code across several targeted platforms. Its main goal is to reuse the code across different types of .Net applications with targeted platforms
Let’s create a new .Net Core application to reference a normal class library whether it works or not.
Open Visual Studio 2015 Go to the menu click File> New> Project then choose .net Core from the left menu by selecting ASP.NET Core Web Application like the below image.

I have chosen an ASP.NET Core sample Template, like the below image.

Let’s create another project as a simple class library.

Notice that we are targeting .Net Framework 4.6.1.

Here we can see a warning while we are going to reference it in our ASP.NET Core sample application.

.Net Framework 4.6.1 is unsupported by the .Net Core Application with version 1.0, how we can solve this? Now let’s create another class library that is portable with the specific targeting platform.

Configure the target options.

.Net Framework 4.6 is supporting the same set of portable APIs as .Net Framework 4.5, so it will automatically target .Net Framework 4.5.
Go to properties of the portable class library we can see we have targeted the .Net Framework 4.5, ASP.NET Core 1.0, and Windows 8.

Reference it to our .Net Core Application.

According to the below diagram, we have now three different Base Class Libraries (BCL) that are targeted to specific environments. The problem here is writing code for multiple .NET platforms. It is also hard to figure out supported APIs on different platforms.








Manav PandyaPosted Nov 20, 2016, 12:25 AM
Nice and clear explaination Shashangka Shekhar sir