1
votes

I have a WinForms/WPF application and I'm trying to use .NET Desktop Build Template. Since, for the moment, I'd rather not to install Visual Studio on TFS server machine, I'm trying to make it work without it. I already installed and configured the build agent (vsts-agent-win7-x64-2.122.1 version, the last one I guess) executing the config command. I also edited the build template, disabling the VS tasks, as you can see by the screenshot. NuGet 4.3.0

Log: NuGet 4.3.0 Build Failed Logs

I have NuGet.exe in several versions (3.3, 3.5, 4.0) under the folder: C:\agent_work_tasks\NuGetToolInstaller_2c65196a-54fd-4a02-9be8-d9d1837b7c5d\0.1.3\node_modules\nuget-task-common\NuGet

And I'm under a corporate firewall+proxy with an auto configuration script.

In Visual Studio 2017 I've set PackageReference format, just in case...

A little update: it all went well just the first time. All the other builds failed :/ I enabled the debug mode and this is the log:

2018-01-08T09:12:43.1617923Z ##[debug]Evaluating condition for step: 'Use NuGet 4.3.0'
2018-01-08T09:12:43.1617923Z ##[debug]Evaluating: succeeded()
2018-01-08T09:12:43.1617923Z ##[debug]Evaluating succeeded:
2018-01-08T09:12:43.1617923Z ##[debug]=> (Boolean) True
2018-01-08T09:12:43.1617923Z ##[debug]Expanded: True
2018-01-08T09:12:43.1617923Z ##[debug]Result: True
2018-01-08T09:12:43.1617923Z ##[section]Starting: Use NuGet 4.3.0
2018-01-08T09:12:43.1930405Z ==============================================================================
2018-01-08T09:12:43.1930405Z Task         : NuGet Tool Installer
2018-01-08T09:12:43.1930405Z Description  : Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this step to change the version of NuGet used in the NuGet steps.
2018-01-08T09:12:43.1930405Z Version      : 0.1.3
2018-01-08T09:12:43.1930405Z Author       : Microsoft Corporation
2018-01-08T09:12:43.1930405Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=852538)
2018-01-08T09:12:43.1930405Z ==============================================================================
2018-01-08T09:12:43.6305452Z ##[debug]agent.workFolder=C:\agent\_work
2018-01-08T09:12:43.6305452Z ##[debug]loading inputs and endpoints
2018-01-08T09:12:43.6305452Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2018-01-08T09:12:43.6305452Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2018-01-08T09:12:43.6305452Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2018-01-08T09:12:43.6305452Z ##[debug]loading INPUT_CHECKLATEST
2018-01-08T09:12:43.6305452Z ##[debug]loading INPUT_VERSIONSPEC
2018-01-08T09:12:43.6305452Z ##[debug]loaded 5
2018-01-08T09:12:43.7086709Z ##[debug]check path : C:\agent\_work\_tasks\NuGetToolInstaller_2c65196a-54fd-4a02-9be8-d9d1837b7c5d\0.1.3\task.json
2018-01-08T09:12:43.7086709Z ##[debug]set resource file to: C:\agent\_work\_tasks\NuGetToolInstaller_2c65196a-54fd-4a02-9be8-d9d1837b7c5d\0.1.3\task.json
2018-01-08T09:12:43.7086709Z ##[debug]system.culture=en-US
2018-01-08T09:12:43.7242974Z ##[debug]versionSpec=4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]checkLatest=false
2018-01-08T09:12:43.7242974Z ##[debug]isExplicit: 4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]explicit? true
2018-01-08T09:12:43.7242974Z ##[debug]Exact match expected on version: 4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]Trying to get tool from local cache
2018-01-08T09:12:43.7242974Z ##[debug]isExplicit: 4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]explicit? true
2018-01-08T09:12:43.7242974Z ##[debug]Agent.Version=2.122.1
2018-01-08T09:12:43.7242974Z ##[debug]Agent.ToolsDirectory=C:\agent\_work\_tool
2018-01-08T09:12:43.7242974Z ##[debug]checking cache: C:\agent\_work\_tool\NuGet\4.3.0\x64
2018-01-08T09:12:43.7242974Z ##[debug]not found
2018-01-08T09:12:43.7242974Z ##[debug]Agent.Version=2.122.1
2018-01-08T09:12:43.7242974Z ##[debug]Agent.ToolsDirectory=C:\agent\_work\_tool
2018-01-08T09:12:43.7242974Z ##[debug]isExplicit: 4.0.0
2018-01-08T09:12:43.7242974Z ##[debug]explicit? true
2018-01-08T09:12:43.7242974Z ##[debug]isExplicit: 4.3.0
2018-01-08T09:12:43.7242974Z ##[debug]explicit? true
2018-01-08T09:12:43.7242974Z ##[debug]evaluating 1 versions
2018-01-08T09:12:43.7399207Z ##[debug]match not found
2018-01-08T09:12:43.7399207Z ##[debug]Querying versions list
2018-01-08T09:13:04.7988484Z ERR:connect ETIMEDOUT 93.184.221.200:443
2018-01-08T09:13:04.7988484Z ##[debug]task result: Failed
2018-01-08T09:13:04.7988484Z ##[debug]Processed: ##vso[task.complete result=Failed;]
2018-01-08T09:13:04.8144544Z ##[section]Finishing: Use NuGet 4.3.0

What it's strange is that it can't find the cached folder where Nuget 4.3.0 (C:\agent_work_tool\NuGet\4.3.0\x64) is supposed to be found even though I manually created it and put the exe into it. Any other ideas?

3

3 Answers

2
votes

This error seems not related to VS installed or not. NuGet Tool Installer task is just downloads and caches the specified version of NuGet and adds it to the PATH.

Compare with the log of succeed task as below:

2017-12-29T09:35:25.5666249Z Author       : Microsoft Corporation
2017-12-29T09:35:25.5666381Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=852538)
2017-12-29T09:35:25.5666532Z ==============================================================================
2017-12-29T09:35:26.5048207Z Downloading: https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe
2017-12-29T09:35:26.6795171Z Caching tool: NuGet 4.3.0 x64
2017-12-29T09:35:26.6906111Z Using version: 4.3.0
2017-12-29T09:35:26.6912667Z Found tool in cache: NuGet 4.3.0 x64
2017-12-29T09:35:26.6913042Z Using tool path: d:\a\_tool\NuGet\4.3.0\x64
2017-12-29T09:35:26.6915843Z Prepending PATH environment variable with directory: d:\a\_tool\NuGet\4.3.0\x64
2017-12-29T09:35:26.7016016Z ##[section]Finishing: Use NuGet 4.3.0

The ETIMEDOUT error occurs when download the version 4.3.0 nuget.exe tool from internet https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe.

The issue should related to your network environment on your build agent, such as firewall, proxy. You could also give a try with using the same Nuget task on an agent which has Visual Studio installed and in the same network environment. This will narrow down the error related to VS or not.

2
votes

Ok, I solved using the x64.complete trick, as stated here. But still I'm puzzled if that allows the download of nuget.exe or not. At the moment it uses 4.3.0, but it's a workaround because that was downloaded before, not during the build agent process. And in case a new version comes out, I should do it manually, just like I did it now. That's not particularly comfortable.

0
votes

NOTE : Possible duplicate of TFS2017.2 NuGet restore task - ETIMEDOUT 93.184.221.200:443

To get this working, we modified our Build Agents' environment vars, adding

http_proxy=http://wsa.arz.de:3128
https_proxy=http://wsa.arz.de:3128

Hope this helps