我正在嘗試使用MSBuild擴展在Jenkins上構建解決方案。我已將解決方案從VS 2013遷移到VS 2015.爲了能夠恢復Visual Studio 2015中的NuGet包,我必須按照以下建議移除.nuget文件夾:http://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore。使用MSBuild 12構建Visual Studio 2015解決方案
現在的問題是,MSBuild需要.nuget文件夾才能夠恢復nuget軟件包。
Build FAILED.
"E:\_JENKINS\workspace\Project1 - Deploy DEVELOP to BuildServer\Solution1\Build\Build.proj" (DeployTarget target) (1) ->
E:\_JENKINS\workspace\Project1 - Deploy DEVELOP to BuildServer\Solution1\Build\Build.proj(50,5):
error MSB4019: The imported project "E:\_JENKINS\workspace\Project1 - Deploy DEVELOP to BuildServer\Solution1\.nuget\NuGet.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
我把事情混淆了嗎?我做錯了什麼嗎?
因爲只有一個可以工作:MSBuild或Studio Package Restore。
因此,無論我將包文件夾添加到混帳或通過命令行恢復或MSBuild恢復替換解決方案中的自動恢復。但無論如何,兩種解決方案似乎都是錯誤的。
只需從項目文件(csproj)中刪除對該目標文件的引用,然後在編譯之前使用'nuget restore solution.sln'來恢復軟件包。 NuGet文檔更多地涉及這種遷移。 –