简体   繁体   中英

Project '..\someProject.csproj' targets 'netcoreapp2.2'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.8'

I am trying to build a project with below versions -

<PropertyGroup>
    <TargetFrameworks>net48;net5.0</TargetFrameworks>
</PropertyGroup>

In this project, there is a reference project which also targets the same version .

When I try to build the project I get the below error -

在此处输入图像描述

Please help me to resolve this.

Observation - When I try to build these projects separately for both 4.8 and 5.0 they compile without errors .

TIA

It seems like you are referencing a library with a different .net version. Try finding another (version of the) library that uses .netframework 4.8

.net core version 2.2 is not compatible with .net framework 4.8.

You can low you project to .net core 2.1 that is stil compatible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM