2016-08-25 72 views
0

我有一個小的dotnet核心應用程序,並希望在jenkins上構建它。 爲了做到這一點,我在build slave上安裝了dotnet core。構建服務器上的Dotnet恢復失敗

本地,我可以使用相同的命令successfuly(甚至在我的Mac)

dotnet restore --configfile .nuget/NuGet.Config 

在恢復構建服務器失敗的一個包恢復。

Started by user jenkins 
Building remotely on 2c3bff31e594 in workspace /root/workspace/Test 
Cloning the remote Git repository 
... 
+ dotnet restore --configfile .nuget/NuGet.Config 

Welcome to .NET Core! 
--------------------- 
... 
log : Installing System.Runtime 4.1.0-rc2-24027. 
log : Installing System.Diagnostics.Tools 4.0.1-rc2-24027. 
log : Installing System.Reflection.Extensions 4.0.1-rc2-24027. 
... 
log : Restoring packages for /root/workspace/Test/test/Test.DataAccess.Tests/project.json... 
log : Failed to download package from 'https://api.nuget.org/v3-flatcontainer/remotion.linq/2.1.1/remotion.linq.2.1.1.nupkg'. 
log : Response status code does not indicate success: 404 (Not Found). 

這裏奇怪的是,如果我打的網址從日誌 「https://api.nuget.org/v3-flatcontainer/remotion.linq/2.1.1/remotion.linq.2.1.1.nupkg」鏈接,該包是他們的。

回答

0

可能是防火牆或任何其他本地設置

可能是防火牆。 ID在計算機上安裝fiddler,看看是什麼確切的請求

爲的NuGet porxy這樣添加小提琴手:

https://docs.nuget.org/consume/nuget-config-settings#proxy-settings

Proxy settings 
section: config 
keys: http_proxy, http_proxy.user, http_proxy.password and no_proxy. 

Allows you to set the proxy settings to be used while connecting to your NuGet feed. More details here. 

This key can be added using NuGet.exe Config -Set command. 

It can also be set via environment variables http_proxy and no_proxy. http_proxy should be specified in the format http://[username]:[password]@proxy.com whereas no_proxy should be a comma-separated list of domains to bypass the proxy server. 

Note 
The "http_proxy.password" key value is encrypted before storing in the nuget.config file. Hence it can not be added manually by directly updating the config file. 
相關問題