-2

I'm currently getting this error:

The project […] has "netcoreapp2.1" as destiny. This Project cannot be referenced with ".NETFramework,Version=v4.6.1" as Destiny.

I get the error, my project is in Net. Framework and the library in .NET Code. Ok.

Problem is that project can apperently only be in Net. Framework (it's a Windows form) and not in any other one, and library only in .NET Core, attempting to change it in project properties is no use.

How can it be achieved what I'm mentioning?

Lukasz Szczygielek
  • 2,768
  • 2
  • 20
  • 34
user2638180
  • 1,013
  • 16
  • 37

2 Answers2

2

Unfortunately, this cannot be achieved. If you do have the source code, you can change the target in the netcore project to netstandard which can be referenced by both netcore and .NET.

spider913
  • 102
  • 9
1

.NET Core is not compatible with .NET Framework as @spider913 said. To share code between them you should create a .NET Standard library. .NET Standard has versions, so it is important to understand which versions of frameworks you want to use with common library.

Please familiarize with .NET Standard overview. I think that this blog post will be good also to understand what is a .NET Standard.

Lukasz Szczygielek
  • 2,768
  • 2
  • 20
  • 34