How to use PCL in an ASP.NET Core 1.0 RC2 project

I want to use a simple (POCO only without other dependencies) PCL with goals

  • Xamarin.Android
  • Universal Windows 10
  • ASP.NET Core 1.0

in the ASP.NET Core 1.0 RC2 project (all in one solution). I added this import to my project. Json:

"frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "dnxcore50", "portable-net451+win8" ], "dependencies": { "PCL.Library": { "target": "project" } } } } 

I get no errors (compilation or otherwise), and the PCL.Library project PCL.Library displayed in links (without warning signs or anything else). But I cannot use it in my ASP.NET Core 1.0 RC2 project, because using statements do not allow, as if PCL were not referenced at all.

How do I set up a PCL project and my ASP.NET Core project so that I can use PCL?

Update: it does not work with RTM version. No response from the development team to the GitHub problem leaves me thinking that there is a fundamental problem that makes this impossible.

+3
source share
1 answer

I believe this is due to: https://github.com/aspnet/Home/issues/1356

It’s best to track this tracker and request the current status, although it says that it will be supported in RC2.

This is part of the standard standardization of the .NET platform through netstandard ( https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md )

You can learn more about this here:

http://damien.dennehy.me/blog/2016/01/15/class-library-packages-future-class-libraries/

Note. Today I found a document regarding PCL orientation:

http://dotnet.imtqy.com/docs/core-concepts/libraries/libraries-with-cli.html#how-to-target-a-portable-class-library-pcl

+2
source

All Articles