4
votes

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.

With settings unchanged

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 

Build definition with solution defined

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: Build definition repository tab

The repository structure: Repository structure

2
Can you please show a screenshot from the TFVC or Git repository layout and of the Repository tab of your buil definition? That's where it's configured which files are downloaded to where. By default the build service will try to map the selected Repository or Team project to the Agent's work directory. On the hosted build which is what you're using), that work directory is located in c:\a\1\s, so that path makes total sense from teh perspective of the build system.jessehouwing
@jessehouwing I added the screenshots, I hope that makes it a little clearer.Kailayla
Your initial setup looks right, it should find the solution just fine, though it may not compile. It doesn't do that it seems. I don't see any active issues. blogs.msdn.com/b/vsoservicejessehouwing
Could you add a variable to your build with the name System.Debug and the value true then re-run the build and share a link to the logs?jessehouwing
@jessehouwing The Debug variable was there but indeed set to false. Here's the zip file with the logs: logsKailayla

2 Answers

3
votes

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
votes

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.

enter image description here