11

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?

1

1 Answer 1

24

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.

Sign up to request clarification or add additional context in comments.

1 Comment

This was very useful. After searching for a good hour or so about how to do it, wading through the "reference .net framework from .net core dll" (basically the inverse of what I wanted) and trying to get my .NET Core App 2.0 project to also produce .NET 4.7 compatible bits, this answer made it all click.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.