我正在尝试使用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文档更多地涉及这种迁移。 –