Reputation: 4954
I looked for this question in here but I didn't find the answer.
I have a Class Library project targeting .NET Core 2.0 and a WPF project targeting .NET Full Framework 4.7. I can't reference the class library on the WPF project. I get the following error:
Project 'xxxxxxxx' targets '.NETCoreApp,Version=v2.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.7'.
Is there any way to reference a .NET Core project in a Full Framework one?
Upvotes: 11
Views: 2573
Reputation: 100543
You cannot add a reference to a .NET Core project to a .NET Framework project.
To share code between .NET Core and .NET Framework apps / libraries, the shared project must target .NET Standard. If you create a .NET Standard 2.0 project, it can be used in .NET Framework 4.6.1+ projects and .NET Core 2.0+ projects.
Upvotes: 24