.NET开发

错误处理Your project does not reference ".NETFramework,Version=v4.0" framework. Add a reference to ".NETFramework,Version=v4.0" in the "TargetFrameworks" property of your project file and then re-run NuGet restore.

2025-01-04 31 0

简介

错误信息:

Your project does not reference ".NETFramework,Version=v4.0" framework. Add a reference to ".NETFramework,Version=v4.0" in the "TargetFrameworks" property of your project file and then re-run NuGet restore.

解决方案一: 不要同时打开两个具有共享项目文件夹的解决方案,并且注意切换的时候删除 obj 和 bin 文件夹。

解决方案二:添加以下代码到 .NET Framework 的项目文件(.csproj)中:

<Project>
  ...  <PropertyGroup>
    <BaseOutputPath>$(MSBuildProjectDirectory)/out/$(MSBuildProjectName)/bin</BaseOutputPath>
    <BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/out/$(MSBuildProjectName)/obj</BaseIntermediateOutputPath>
  </PropertyGroup>
  ...</Project>


点赞 0

我的名片

网名:梦宇信息技术

职业:软件开发、Mes系统工程师

现居:福建省-福州市

QQ:703159

站点信息

  • 联系QQ:703159
  • 文章统计97篇文章
  • 标签总数6
  • 加我微信:扫码,加我微信