E
E
egorggegor2020-07-31 17:24:20
.NET
egorggegor, 2020-07-31 17:24:20

How to fix .NET version incompatibility?

I created a project that contains business logic, then created a project that contains the program interface, in the interface project I made a link to the project with business logic. I'm trying to use the functionality from the project with business logic, writes the following error. What can be done?

The project "..\EntityAppTest2\EntityAppTest2.csproj" is for the target platform "netcoreapp3.1". It should not be referenced in a project targeting ".NETFramework,Version=v4.7.2".
EntityAppTestUI

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ayazer, 2020-07-31
@ayazer

you have one part in .no framework and the other part in netcore. Either bring everything to one thing, or use the netstandard of the desired version (then the library will be compatible with both netframework and netcore).
as I understood from the description - on the netframework you have exactly the part with the interface, so update the TargetFramework in the second project. the .sln file should look something like

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="..." Version="..." />
       ...
  </ItemGroup>

  ...

</Project>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question