I have a C# project that relegates code to Portable Libraries projects, so they can be reused in .Net and Silverlight environments seamlessly.
The PCLs target .Net45
and Silverlight 5
.
Now I want to use the same PCLs in .Net Core environment. If possible, I want to keep my solution with .Net and Silverlight environments and reuse the Portable projects in a new .Net Core solution.
When I try to add a reference to a regular PCL project from a .Net Core Library, it fails to read the dependency.
NU1001 The dependency could not be resolved.
If I attempt to add a reference to the PCL assembly I get an error:
.NET Core projects only support referencing .NET framework assemblies in this release. To reference other assemblies, they need to be included in a NuGet package and reference that package.
Is it possible to use regular PCLs on .Net Core environment? Or I need to create new .Net Core libraries?
If I need to create new projects, how can I avoid duplicated code?