我使用Visual Studio 2015的GitHub扩展将我的项目克隆到新计算机上.我尝试恢复包,我收到一个错误,说:
NuGet Package restore failed for project PROJECT: Unable to find version 2.0.0 of package 'Microsoft.Net.Compilers'
Run Code Online (Sandbox Code Playgroud)
我已经研究了其他一些类似问题的问题,但这些解决方案都没有对我有用.
我尝试删除packages文件夹,再次打开Visual Studios,然后重建.那并没有解决它.
我尝试在Package Manager Console中手动安装Microsoft.Net.Compilers.
PM> Install-Package Microsoft.Net.Compilers
Run Code Online (Sandbox Code Playgroud)
我尝试从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>
Run Code Online (Sandbox Code Playgroud)
我尝试重新安装所有包
Update-Package –reinstall
Run Code Online (Sandbox Code Playgroud)
到目前为止,我没有运气解决问题.任何帮助表示赞赏.
编辑:
I tried the response below and received this …Run Code Online (Sandbox Code Playgroud)