MS Build步骤中的Nuget Restore [英] Nuget Restore in MS Build Step

查看:94
本文介绍了MS Build步骤中的Nuget Restore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的asp.net Web应用程序中,我有5个项目和nuget.org的解决方案.在TFS构建定义中,

In my asp.net web application, i have solution with 5 projects and nuget.org. In TFS Build Definition,

1)在 Visual Studio构建任务

         Nuget packages getting restored.    

2)在 MS构建任务

如果我选择Restore Nuget软件包,则找不到nuget软件包,并且步骤失败并显示消息-进程'NuGet.exe'退出,代码为'1'."

If I select Restore Nuget packages, It's not finding nuget packages and step getting failed with message - "Process 'NuGet.exe' exited with code '1'."

我已经在网上尝试了许多参考资料,但都无济于事.有关如何解决此问题的任何建议?
我是否需要在nuget.config文件中进行任何更改以支持恢复?
打包到单个项目.

I have tried many references online and none worked. Any suggestions on how to solve this?
Do i need to make any changes in the nuget.config file to support restoring
packages to individual projects.

推荐答案

请勿在MS构建任务配置中直接选择还原Nuget内容.此选项已弃用.要还原NuGet软件包,请在构建之前添加一个NuGet安装程序步骤.

Do not directly select Restore Nuget pacakges in MS build task configuration. This option is deprecated. To restore NuGet packages, add a NuGet Installer step before the build.

(重要).不建议使用此选项.确保清除此复选框,而是使用 NuGet安装程序构建步骤.

(Important) This option is deprecated. Make sure to clear this checkbox and instead use the NuGet Installer build step.

源链接: MSBuild

此外,您还可以在Visual Studio Build任务中构建单个项目,而不是整个解决方案.只需选择项目(.* proj )文件而不是 .sln 文件.除非您要构建自定义的MSBuild项目文件,否则我们建议您使用MSBuild步骤而不是Visual Studio Build步骤.

Besides, you could also build single project not the entire solution in Visual Studio Build task. Just select the project (.*proj) files instead of .sln file. Unless you are building a customized MSBuild project file, then we recommend you use the MSBuild step instead of the Visual Studio Build step.

您还可以尝试使用Visual Studio Build任务来构建单个项目,看看问题是否仍然存在.

You could also try to build single project using Visual Studio Build task, see if the issue is still exists.

这篇关于MS Build步骤中的Nuget Restore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆