core icon indicating copy to clipboard operation
core copied to clipboard

Portable Class Library and .NET Core

Open linvi opened this issue 10 years ago • 7 comments

Hello,

I am the developer of Tweetinvi which is a Portable Class Library compatible with a very wide range of devices. I would like to ensure that Tweetinvi can work with .NET Core projects.

I would like to do so by keeping the PCL. Is it possible? If yes, which PCL target should I use? If I use ASP.NET Core 1.0 target, it won't work with .NET Core Console projects.

With .NET Core Class Library I receive the following error :

The following projects are not supported as references.
PCL Library has target frameworks that are incompatible with targets in the current project .NETCore Library.

.NETCore Library : .NETStandard,Version=v1.5
PCL Library : .NETPortable,Version=v4.5,Profile=Profile111

Could you point to any documentation, that I could follow to migrate my portable library? Can the PCL projects work with .NET Core?

Please note that the library is compatible with .NET Framework 4.0.

Thank you.

linvi avatar Jul 06 '16 23:07 linvi

I'm curious about this as well. I was thinking of moving projects I would build to be project.json based and to use multi targeting so that I could build a PCL ,and a native .net core package, and a full .net framework, all from a single set of sources without a pile of different .csprojs for this very reason.

http://stackoverflow.com/questions/38206209/create-a-single-source-project-with-full-net-pcl-and-dotnet-core-assemblies-bu

wpostma avatar Jul 07 '16 01:07 wpostma

Thank you for the link I will take a look at this.

linvi avatar Jul 07 '16 01:07 linvi

We are migrating a project to version 1.0. and can test if you have something in the pipeline.

KirilRusev avatar Jul 11 '16 12:07 KirilRusev

I am not sure what you mean. Are you saying that you are currently migrating PCL into compatible version 1.0 .NET Core library or that you have access to some kind of new PCL target for .NET Core 1.0?

linvi avatar Jul 11 '16 13:07 linvi

@cartermp can you weigh in here? I believe the target to be used for .NET Core libraries is netstandard1.6.

thesmithee avatar Jul 22 '16 18:07 thesmithee

Yep, netstandard1.6 should be the one you try to use.

cartermp avatar Jul 22 '16 20:07 cartermp

OK, with that I think this is the correct answer. There is also guidance on https://docs.microsoft.com/dotnet/ on how to author libraries for .NET Core. Will close this issue. If you still need more help or have more questions, I suggest we open an issue on dotnet/core-docs repo to further discuss.

thesmithee avatar Jul 23 '16 06:07 thesmithee