Visual Studio Team Services - Build fails, definition wrong?

匿名 (未验证) 提交于 2019-12-03 08:28:06

问题:

I've been working on a project for some time now and now I want to use Visual Studio Team Services for it. Locally, the building in Visual Studio doesn't give an error and the application works as intended.
I've checked in this working code to VSTS so it's in the repo and good to go.
Now I want to build it. I created a new Build definition with nothing changed. When I run the build it fails. I tried editing the build definition but with my 0 experience with this I only screw up more and create more errors.

My problem: Apparently, it wants to find C:\a\1\s But I have no idea why and how it came up with that path. What do I have to change in the build definition? I'm new to this so I don't know what all the settings do and where the files are that it needs.
I tried adding the .sln file from the project folder to the build definition (as shown in the 2nd image) but it still want to find that weird path.

So here are the build definitions, steps that go wrong and the errors in the logs.

NuGet restore ***.sln

2016-03-07T10:28:15.8302718Z Set workingFolder to default: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\NuGetInstaller\0.1.18      2016-03-07T10:28:15.9337363Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\NuGetInstaller\0.1.18\NuGetInstaller.ps1      2016-03-07T10:28:16.5636975Z ##[error]Could not find a part of the path 'C:\a\1\s'.      2016-03-07T10:28:16.5876990Z ##[error]No solution was found using search pattern 'C:\a\1\s\**\*.sln'. 

Copy Files to: $(build.artifactstagingdirectory)

2016-03-07T10:28:16.6827013Z Set workingFolder to default: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11      2016-03-07T10:28:17.1800860Z ##[debug]check path : C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\task.json      2016-03-07T10:28:17.1810857Z ##[debug]set resource file to: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\task.json      2016-03-07T10:28:17.1810857Z ##[debug]system.culture=en-US      2016-03-07T10:28:17.1820859Z ##[debug]load strings from: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\task.json      2016-03-07T10:28:17.1820859Z ##[debug]load loc strings from: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\strings\resources.resjson\en-US\resources.resjson      2016-03-07T10:28:17.1820859Z ##[debug]Contents=**\bin\release\**      2016-03-07T10:28:17.1830859Z ##[debug]SourceFolder=C:\a\1\s      2016-03-07T10:28:17.1830859Z ##[debug]check path : C:\a\1\s      2016-03-07T10:28:17.1840858Z ##[debug]load strings from: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\node_modules\vsts-task-lib\lib.json      2016-03-07T10:28:17.1840858Z ##[debug]load loc strings from: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\node_modules\vsts-task-lib\strings\resources.resjson\en-US\resources.resjson      2016-03-07T10:28:17.1850860Z Not found SourceFolder: C:\a\1\s      2016-03-07T10:28:17.1860857Z ##[debug]task result: Failed  

NuGet restore $/Test project/QRM/QRM.sln

2016-03-07T10:47:46.0629142Z Set workingFolder to default: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\NuGetInstaller\0.1.18      2016-03-07T10:47:46.1969152Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\NuGetInstaller\0.1.18\NuGetInstaller.ps1      2016-03-07T10:47:46.8519190Z ##[error]Cannot find path 'C:\a\1\s\QRM\QRM.sln' because it does not exist.      2016-03-07T10:47:46.8639180Z C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\agent\worker\tools\NuGet.exe restore "C:\a\1\s\QRM\QRM.sln"  -NonInteractive      2016-03-07T10:47:48.8829320Z MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.      2016-03-07T10:47:48.8999324Z ##[error]Could not find a part of the path 'C:\a\1\s\QRM\QRM.sln'.      2016-03-07T10:47:48.9249320Z ##[error]Unexpected exit code 1 returned from tool NuGet.exe 

Copy Files to: $(build.artifactstagingdirectory)

2016-03-07T10:47:49.0239330Z Set workingFolder to default: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11      2016-03-07T10:47:49.6659427Z ##[debug]check path : C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\task.json      2016-03-07T10:47:49.6779370Z Not found SourceFolder: C:\a\1\s      2016-03-07T10:47:49.6789372Z ##[debug]set resource file to: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\task.json      2016-03-07T10:47:49.6799369Z ##[debug]system.culture=en-US      2016-03-07T10:47:49.6799369Z ##[debug]load strings from: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\task.json      2016-03-07T10:47:49.6809368Z ##[debug]load loc strings from: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\strings\resources.resjson\en-US\resources.resjson      2016-03-07T10:47:49.6809368Z ##[debug]Contents=**\bin\release\**      2016-03-07T10:47:49.6809368Z ##[debug]SourceFolder=C:\a\1\s      2016-03-07T10:47:49.6819369Z ##[debug]check path : C:\a\1\s      2016-03-07T10:47:49.6819369Z ##[debug]load strings from: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\node_modules\vsts-task-lib\lib.json      2016-03-07T10:47:49.6829365Z ##[debug]load loc strings from: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\CopyFiles\1.0.11\node_modules\vsts-task-lib\strings\resources.resjson\en-US\resources.resjson      2016-03-07T10:47:49.6829365Z ##[debug]task result: Failed 

Edit
The build definition's repository tab:

The repository structure:

回答1:

According to the logs you provided:

2016-03-07T15:00:44.4590685Z Done syncing repository Test project to version 3 (workspace version -1) 

This issue may caused by the access permission of your build account. Please check and make sure the account that the build agent use has the permission to access to your code repository.

Same issues for your reference:

TFS 2105 build issue

TFS 2015 Build Agent failing syncing the repository



回答2:

When you queued a new build, did you enter a Source Version to get? I see a Version 3 coming by in the logs, but no files are actually transferred. If you want to fetch a specific changeset, you need to enter C3 instead of 3. But I'd recommend to just leave the box empty.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!