0

I am trying to implement CI (Continuous Integration) using TFS for my ASP.NET website (Website Project). I am constantly getting following errors for days. Following is the full log. Its simply not getting latest version to the local directory, that's why its giving error....MSBUILD : error MSB1009: Project file does not exist. I have checked that TFS is not getting latest version, I am not sure why...!!!!

Any help is truly appreciated, Thank You in advance.

2018-02-26T22:18:13.2365258Z ##[section]Starting: Build
2018-02-26T22:18:13.2385315Z Current agent version: '2.117.2'
2018-02-26T22:18:13.5846688Z ##[section]Starting: Initialize Job
2018-02-26T22:18:13.5926727Z Prepare build directory.
2018-02-26T22:18:13.6386956Z Set build variables.
2018-02-26T22:18:13.6457073Z Download all required tasks.
2018-02-26T22:18:13.6878173Z ##[section]Finishing: Initialize Job
2018-02-26T22:18:13.7139315Z ##[section]Starting: Get Sources
2018-02-26T22:18:13.7831194Z Prepending Path environment variable with 
directory containing 'tf.exe'.
2018-02-26T22:18:13.7841199Z Querying workspace information.
2018-02-26T22:18:14.8803708Z ##[command]tf vc workspace /delete 
ws_3_398;91fe1581-91d7-4cee-bb0c-81e67ca0f83a 
/collection:https://tfs.ups.com/tfs/UpsProd/ /loginType:OAuth 
/login:.,******** /noprompt
2018-02-26T22:18:18.9914765Z ##[command]tf vc workspace /new /location:local 
/permission:Public ws_3_398 /collection:https://tfs.ups.com/tfs/UpsProd/ 
/loginType:OAuth /login:.,******** /noprompt
2018-02-26T22:18:20.8991396Z ##[command]tf vc workfold /unmap 
/workspace:ws_3_398 $/ /collection:https://tfs.ups.com/tfs/UpsProd/ 
/loginType:OAuth /login:.,******** /noprompt
2018-02-26T22:18:21.9989171Z ##[command]tf vc workfold /map 
/workspace:ws_3_398 "$/P04C/CRMSA_ESTAT_ESP_SRC/Tools/ESP Website" 
"D:\UAMCAgent\_work\3\s\ESP Website" 
/collection:https://tfs.ups.com/tfs/UpsProd/ /loginType:OAuth 
/login:.,******** /noprompt
2018-02-26T22:18:22.7551176Z ##[command]tf vc get /version:2028385 
/recursive /overwrite D:\UAMCAgent\_work\3\s /loginType:OAuth 
/login:.,******** /noprompt
2018-02-26T22:18:23.6383909Z All files are up to date.
2018-02-26T22:18:23.6615759Z ##[section]Finishing: Get Sources
2018-02-26T22:18:23.6636095Z ##[section]Starting: Build solution

2018-02-26T22:18:23.6716308Z 
2018-02-26T22:18:23.6716308Z Task         : Visual Studio Build
2018-02-26T22:18:23.6716308Z Description  : Build with MSBuild and set the 
Visual Studio version property
2018-02-26T22:18:23.6716308Z Version      : 1.119.0
2018-02-26T22:18:23.6716308Z Author       : Microsoft Corporation
2018-02-26T22:18:23.6716308Z Help         : [More Information]
(https://go.microsoft.com/fwlink/?LinkID=613727)
2018-02-26T22:18:23.6716308Z 
2018-02-26T22:18:26.0666962Z ##
[command]"D:\UAMCAgent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-
affca411ecda\1.119.0\ps_modules\MSBuildHelpers\vswhere.exe" -version 
[15.0,16.0) 
-latest -format json
2018-02-26T22:18:26.3567330Z ##[command]"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Professional\MSBuild\15.0\Bin\amd64\msbuild.exe" 
"D:\UAMCAgent\_work\3\s\ESP Website\ESP_WEB.sln" /nologo /nr:false 
/dl:CentralLogger,"D:\UAMCAgent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-
96ab-

  tedTask.MSBuild.Logger.dll";"RootDetailId=0ff9d26a-993f-4bb6-a05a-
582b3d0d7a52|SolutionDir=D:\UAMCAgent\_work\3\s\ESP 
Website"*ForwardingLogger,"D:\UAMCAgent\_work\_tasks\VSBuild_71a9a2d3-a98a-
4caa-96ab-


tedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true 
/p:WebPublishMethod=Package 
/p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true 
/p:PackageLocation="D:\UAMCAgent\_work\3\a\\" /p:platform="any cpu" 
/p:configuration="release" /p:VisualStudioVersion="15.0" 
/p:_MSDeployUserAgent="TFS_b14eb634-1b27-4e21-8f9e-
13237b04eab7_build_831_73513"
2018-02-26T22:18:26.4365554Z MSBUILD : error MSB1009: Project file does not 
exist.
2018-02-26T22:18:26.4365554Z Switch: D:\UAMCAgent\_work\3\s\ESP 
Website\ESP_WEB.sln
2018-02-26T22:18:26.5830048Z ##[error]Process 'msbuild.exe' exited with code 
'1'.
2018-02-26T22:18:26.6361526Z ##[section]Finishing: Build solution
2018-02-26T22:18:26.6381598Z ##[section]Starting: Post Job Cleanup
2018-02-26T22:18:26.6451749Z ##[section]Finishing: Post Job Cleanup
2018-02-26T22:18:26.6501892Z ##[section]Finishing: Build

1 Answers1

0

According to your log and description, seems TFS get command (Get Source Step)erroneously returns “All files are up to date.” and cause the followed MSBuild step failed.

First try following steps to check if it works by set clean during get source:

  1. Modify your definition : In Repository set Clean to True, Clean option to Sources (try to set Source Directory if that not work)
  2. Also enable Clean option for your build solution task

enter image description here

Another possibility is the root sources folder (D:\UAMCAgent\_work\3\s) is not mapped - i.e. workspace does not contain a root mapping.

And suggest you double check the related build account permission, also give it local admin permission on the build agent.

You could disable the default get source steps in the build definition. And use your own script to do the get source/pull files to see if you get the same situation. How to, please follow: Is it able to ignore/disable the first step Get source in vNext Build?

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Take a look at this question about how to use own script to get source: https://stackoverflow.com/questions/48458701/tfs-vnext-build-getsources-task-does-not-get-files-from-folder-with-restricted/48460506#48460506 – PatrickLu-MSFT Feb 28 '18 at 07:26
  • Thanks so much for your reply, I have tried all of the options except following. You could disable the default get source steps in the build definition. And use your own script to do the get source/pull files to see if you get the same situation. How to, please follow: Is it able to ignore/disable the first step Get source in vNext Build? – Devang Panchalia Feb 28 '18 at 21:35
  • Also, I am not sure how I can attach my build defintion here so you can have a look at it. – Devang Panchalia Feb 28 '18 at 21:36
  • 0 down vote accept According to your log and description, seems TFS get command (Get Source Step)erroneously returns “All files are up to date.” and cause the followed MSBuild step failed. This exactly is the problem. – Devang Panchalia Feb 28 '18 at 21:43
  • this is my output from the "Get Sources" 2018-02-28T21:50:00.6388741Z ##[section]Starting: Get Sources 2018-02-28T21:50:00.7291186Z Prepending Path environment variable with directory containing 'tf.exe'. 2018-02-28T21:50:00.7301207Z Querying workspace information. 2018-02-28T21:50:02.6662864Z ##[command]tf vc get /version:2031082 /recursive /overwrite D:\UAMCAgent\_work\3\s /loginType:OAuth /login:.,******** /noprompt 2018-02-28T21:50:03.4960950Z All files are up to date. 2018-02-28T21:50:03.5211636Z ##[section]Finishing – Devang Panchalia Feb 28 '18 at 22:10
  • Sorry for not formatting it, I still dont have how I can format it properlyin this website.....Also, Whenever I type enter, it posts the comment instead of going to next line... – Devang Panchalia Feb 28 '18 at 22:11
  • 1
    If I ran following command on VS command prompt, it does get the latest code... tf vc get /version:2031082 /recursive /overwrite D:\UAMCAgent_work\3\s – Devang Panchalia Feb 28 '18 at 22:17
  • @DevangPanchalia If you directly ran the same command on VS command prompt successfully pull the latest code. Which account you are using on the build agent to run the `tf.exe command`. Try to also use the build service account. You should **double check the permission** of your build service account, make sure it has enough permission to source code and local folder `D:\UAMCAgent_work\3\s`. Also give the build service account local Administrator permission and try again. – PatrickLu-MSFT Mar 01 '18 at 10:52
  • Which account you are using on the build agent to run the tf.exe command....Try to also use the build service account. : How can i find out my account on Build agent..? Or How can i use the build service account..? – Devang Panchalia Mar 05 '18 at 14:56
  • You should double check the permission of your build service account, make sure it has enough permission to source code and local folder D:\UAMCAgent_work\3\s. Also give the build service account local Administrator permission and try again Devang : How can I find out my persmissions on Build Service account..? and also How can I assign it local admin permissions...? – Devang Panchalia Mar 05 '18 at 15:01
  • @DevangPanchalia The build service account is the account when you configure your build agent. `/WindowsServiceLogonAccount:WindowsServiceLogonAccount` Usually the default is NT AUTHORITY\NETWORK SERVICE. More details please refer https://learn.microsoft.com/en-us/vsts/build-release/actions/agents/v1-windows To give build service account local admin permission, you just need to give NT AUTHORITY\NETWORK SERVICE (if it's the name of the user account to use for the service when you configure build agent)local admin permission. – PatrickLu-MSFT Mar 05 '18 at 15:41