-1

I have a custom project and I want to create a reference from this project to .net core (and .net 5) projects, I got the following error:

'..\Core2\Core2.csproj' targets 'netcoreapp3.1'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.0'. C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets
line 1662

  1. Can the custom project be a ".net core"? it is .netframework (I think it is a default, it is not written in vstemplate/props/targets files.
  2. Can a custom project refer to a .net core project?
  • The shared project between them all must be a .NET shared library. – Jimenemex May 06 '21 at 13:13
  • Does this answer your question? [Reference a .NET Core Library in a .NET 4.6 project](https://stackoverflow.com/questions/33810504/reference-a-net-core-library-in-a-net-4-6-project) – GSerg May 06 '21 at 13:13
  • Fixed by adding non empty environment variable "TargetRuntime" – Elad Yaakovi May 12 '21 at 07:35

1 Answers1

0

Fixed by adding non empty environment variable "TargetRuntime"