简体   繁体   English

恢复nuget包Jenkins

[英]Restore nuget package Jenkins

When I tried to use Jenkins as our CI environment to build ASP.NET MVC5 project, I set up to use MSBuild.exe to build project. 当我尝试使用Jenkins作为我们的CI环境来构建ASP.NET MVC5项目时,我设置为使用MSBuild.exe来构建项目。 But when the cmd run into restore nuget packages, it stucked. 但是,当cmd遇到restore nuget软件包时,它卡住了。 The error message is as below: 错误消息如下:

WARNING: Unable to connect to the remote server 警告:无法连接到远程服务器
Unable to find version '3.4.1.9004' of package 'Antlr'. 找不到软件包“ Antlr”的版本“ 3.4.1.9004”。
Build step 'Execute Windows batch command' marked build as failure 构建步骤“执行Windows批处理命令”将构建标记为失败

But if I use windows command line to run the msbuild, it is working and could download the pkg from nuget.org. 但是,如果我使用Windows命令行运行msbuild,则它可以正常工作,并且可以从nuget.org下载pkg。 Error only happened when try to build in Jenkins. 仅在尝试在Jenkins中构建时发生错误。 And my network is fine, but behind a company proxy/firewall, I am not sure what it is. 我的网络很好,但是在公司代理/防火墙的后面,我不确定它是什么。 And I have set to auto restore nuget package in VS2013. 而且我已经设置为在VS2013中自动还原nuget软件包。

Any idea is much more appreciated. 任何想法都值得赞赏。

I finally found out the root cause, it is the Jenkins service has not enough access right. 我终于找到了根本原因,那就是Jenkins服务没有足够的访问权限。 Open windows services and right click on the Jenkins service, in the security tab, change the default user to whom that has enough access right to the Internet. 打开Windows服务,然后右键单击Jenkins服务,在“安全性”选项卡中,将默认用户更改为具有足够Internet访问权限的默认用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM