2016-09-14 107 views
3

我的項目後,2015年項目加載Visual Studio中對NuGet包Microsoft.Net.Compilers的依賴關係:無法對Microsoft.Net.Compilers添加依賴

<package id="Microsoft.Net.Compilers" version="1.3.2" 
     targetFramework="net461" developmentDependency="true" /> 

但是,如果我在清除後加載的Visual Studio我包文件夾我的項目不會與下面的錯誤加載:

The imported project "C:\MyService\packages\Microsoft.Net.Compilers.1.3.2\tools\Microsoft.CSharp.Core.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets

所以,因爲缺少這是使用的NuGet,這隻能如果我可以加載的項目上建立還原的文件,它不會加載該項目。

+2

使用的NuGet命令行可執行文件來調用'的NuGet restore':在命令行https://www.nuget.org/

這個問題 – jessehouwing

回答

7

您可以使用Nuget命令行工具來恢復您的包。如果你的系統還沒有它,你可以在這裏找到:

nuget restore