我在编译我的项目时遇到以下问题。它是一个 MVC 5 应用程序。这是错误:
严重性代码描述项目文件行抑制状态 错误 此项目引用此计算机上缺少的 NuGet 包。使用 NuGet 包还原来下载它们。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105 .缺少的文件是 ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props。 WikidoctorAdmin E:\我的项目\Wiki-Doctor\Wiki-Doctor.com\Wiki-Doctor.com\WikidoctorAdmin\WikidoctorAdmin.csproj 2107
请帮我解决这个错误。
最佳答案
我遇到了同样的问题,通过在文本编辑器中打开项目并删除以下部分来解决:
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use 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('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
这个项目不需要 Nuget。
希望这对您有所帮助。
关于c# - 获取 Nuget 包丢失错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34516268/