2017-01-02 122 views
1

恢復問題的NuGet恢復nuget.exe版本3.4.4.132正常工作,但在下面的錯誤代碼3.5回報NuGet包在兩個不同的版本

Failed to load msbuild Toolset 
    Could not load file or assembly 'Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 
or one of its dependencies. The system cannot find the file specified. 
An error occurred when executing task 'NugetRestore'. 
Error: NuGet: Process returned an error (exit code 1). 

請幫我在這個問題上。

+0

你在該機器上安裝了什麼版本的Visual Studio? – shytikov

回答

0

這似乎是由於您的路徑中的msbuild.exe是版本3.5。的MSBuild 3.5不有兩個.dll文件的,我們正在試圖加載動態(「Microsoft.Build.dllMicrosoft.Build.Framework.dll」)

請確保NuGet.exe使用的MSBuild 4.0更高。這可以通過確保MSBuild 4.0或更高版本是首先在您的路徑中解析或通過傳遞-msbuildversion選項來完成。

檢查以下命令:

MSBuild.exe /版本

獲取命令MSBuild.exe

希望它能幫助。

+1

我使用了-MsBuildVersion 4.0參數與nuget,但同樣的錯誤轉載。你如何建議MS建立3.5版? – vijay

+2

我已經安裝了MSBuild 12,我也看到了這個問題。 –