Link to the .NET Core Library in .NET 4.5.2

Can I reference the .NET Core library in a .NET 4.5.2 project? I am using the latest version of .NET Core and want to use the same library for my WPF project and my .NET API. If I want to add a link to my project, this window will be shown:

enter image description here

I also tried updating my WPF project to 4.6.1, but that doesn’t change anything.

Update
Now possible with Core 2.0

+7
.net-core
source share
1 answer

At the moment (June 2016) two steps are required:

  • Make sure the .NET Core project is built for net452 or netstandard1.2 (which includes net452 according to the docs ). This ensures that your project outputs a binary file that your .NET 4.5.2 project can use.

  • Create a nuget package from a .NET Core project using dotnet pack . Take it locally or on MyGet. The link to this package in your .NET 4.5.2 application will select the correct binary!

Visual Studio, apparently, will be able to directly refer to .NET Core projects from csproj projects in the future, but at the moment step 2 is the best solution I have found.

+7
source share

All Articles