visual-studio-2015 - 此项目引用了该计算机上缺少的 NuGet 包。

标签 visual-studio-2015 nuget

在我的 Visual studio 2015 update 3 中,将解决方案文件夹复制到另一台 Windows 计算机时遇到以下错误。

错误此项目引用了此计算机上缺少的 NuGet 包。使用 NuGet Package Restore 下载它们。欲了解更多信息,请参阅http://go.microsoft.com/fwlink/?LinkID=322105 。缺少的文件是 ..\packages\Microsoft.Net.Compilers.1.0.0\build**Microsoft.Net.Compilers.props.**

我验证了该项目的 NuGet 包管理器,所有标记为“丢失”的内容旁边都有一个绿色勾号,包括 Microsoft.Net.Compilers。

最佳答案

通过从 .csproj 文件中删除下面提到的代码段解决了该问题

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  <PropertyGroup>
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
  </PropertyGroup>
  <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>

关于visual-studio-2015 - 此项目引用了该计算机上缺少的 NuGet 包。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44455011/

相关文章:

visual-studio - typescript 错误 : "Cannot find name" in Visual Studio

visual-studio-2015 - 使用 "xUnit.net Test Support for ReSharper 10"在带有 ReSharper Ultimate 10 的 Visual Studio 2015 中运行 xUnit 测试时出错

c# - Visual Studio 2010 - 卸载 NuGet

.net - 如何使用 NuGet 包部署 T4 包含文件

unit-testing - 在VS2015中运行C#单元测试时的延迟非常长

load - Visual Studio 2015 CTP 6 Windows 10 项目设计器加载失败

c# - C# 的 Antlr.Runtime 中缺少类

asp.net - NuGet - 给定类型名称或 DLL,如何找到 NuGet 包?

c# - 带有黄色图标的 Visual Studio 2019 项目依赖项

visual-studio-2012 - VS2015 中的 MSBuild 错误 MSB4018 : The "Link" task failed unexpectedly