Error MSB3644

The reference assemblies for framework ".NETFramework,Version=v5.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. BuildProgram.gen C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 1179

这该咋办?

之前使用的是VS2017,更换成VS2019就能成功编译。

dotnet --info

本地已经安装.NET 5.0

借鉴参考以下信息:

找不到 .NETFramework,Version=v5.0 的引用程序集。要解决此问题,请为此框架版本安装开发人员工具包(SDK/目标包)或者重新定向应用程序。

解决办法:

1.安装.net 5.0 SDK (如果安装这个没有用就用方法2)

2.把visual studio 2019 升级到 v 16.8 .

菜单 > visual studio installer >更新