I am trying to figure out how to close the loop in our build process, where we apply the version number to AssemblyInfo files. * as part of the assembly process.
We are in the midst of moving from local tfs to visual studio team services. Many of our current built-in modules update the version number in order to synchronize it with the build number and additionally check these files for the original control during assembly.
I successfully used the script located in msdn as an example to start customizing the build process.
Now I try to check the files back to the original control, but I get an error:
#[error]TF30063: You are not authorized to access https://subdomain.visualstudio.com/DefaultCollection. #[error]Process completed with exit code 100 and had 1 error(s) written to the error stream.
I am currently using tf.exe to try to do this. First enter the path to the tool at the top of the powershell script;
# get the tf command line tool path $tfexe = [System.IO.Path]::GetFullPath($env:VS140COMNTOOLS + "..\..\common7\ide\tf.exe") if (-Not (Test-Path $tfexe)) { Write-Error "Could not find tf.exe at '$tfexe'" exit 1 } else { Write-Host "Found tf.exe at '$tfexe'" }
Then change the loop to check the file, and then check the files again.
# Apply the version to the assembly property files $files = gci $Env:BUILD_SOURCESDIRECTORY -recurse -include "*Properties*","My Project" | ?{ $_.PSIsContainer } | foreach { gci -Path $_.FullName -Recurse -include AssemblyInfo.* } if($files) { Write-Host "Will apply $NewVersion to $($files.count) files." foreach ($file in $files) {
Is this the right way to do this? If the build service is not allowed access, how can it GET the code, compile it, and then POST the artifact somewhere?
source share