Geeks With Blogs
Gaurav Bodar - ALM Consultant, TFS specialist ALM, TFS, Agile, Scrum, Sharepoint, IT Service

TFS 2015 Vnext build gives you the option for running Visual studio build which will ideally have these options

clip_image001

1) Get Source 

This action is Hidden but as you can understand TFS will download source files from TFS based on your settings on Repository for Mappings to Source. There are chances that it will complain about files already exist

Warning C:\Agent\_Work\4\s\Tests\project.xml - Unable to perform the get operation because the file already exists locally

Warning C:\Agent\_Work\4\s\Tests\project - Gateway - .xml - Unable to perform the get operation because the file already exists locally

One or more errors occurred while performing a get operation for workspace ws_4_9;Build\5a940eb8-a66f-4dc3-a742-ad23cee5dc01

The quick Solution is always clean the workspace before starting the new build.

clip_image003

2) Nuget Restore 

If you are using Nuget restore in your build and if you have some Local repository for your Nuget , TFS nuget Restore will fail for any Local Nuget package download

2016-10-12T05:30:08.1016689Z Set workingFolder to default: C:\Agent\tasks\NuGetInstaller\0.1.18

2016-10-12T05:30:08.1173069Z Executing the powershell script: C:\Agent\tasks\NuGetInstaller\0.1.18\NuGetInstaller.ps1

2016-10-12T05:30:08.4766837Z C:\Agent\agent\worker\tools\NuGet.exe restore "C:\Agent\_Work\4\s\Services.sln" -NoCache -NonInteractive

2016-10-12T05:30:08.8204175Z MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.

2016-10-12T05:30:22.4923248Z ##[error]Unable to find version '2.0.5939.19993' of package 'FOO.Logging'.

2016-10-12T05:30:22.5860716Z ##[error]Unexpected exit code 1 returned from tool NuGet.exe

To avoid this issue when we setup the Build Agent we should be running it with our domain account which has access to this Nuget Repository and not with default Account NT Authority\Network Service

3) Copy and Publish Build Artefacts

This action fails with "TF14044: Access Denied: User Project Collection Build Service needs the Admin Workspaces global permission(s).".

To Avoid this issue we need to install TFS 2015 Update 3

4) TFS 2015 Build Clean up

TFS 2015 Build clean-up is daily bases and not on count. I am not fan of this logic because we have 4-5 Projects running simultaneously and continuous build will occupy lots of space. Plus, I like to retain some baseline release builds for longer period.

So I have created quick PowerShell script for clean-up and scheduled it as Command line in TFS build.

I am using 2 for keeping latest 2 builds and delete anything older than that. You can retain more number of builds by increasing that number.

"Get-ChildItem '\\dev-exe-002\drop\* ' -Directory | Sort-Object CreationTime -Descending | Select-Object -Skip 2 | Remove-Item -Recurse -Force"

Add Command line in your build step and provide parameter like

clip_image005

Posted on Wednesday, October 19, 2016 10:34 AM team foundation server , tfs build , TFS build 2015 , TFS build Vnext | Back to top


Comments on this post: TFS 2015 Build quick Issues and Fix

# re: TFS 2015 Build quick Issues and Fix
Requesting Gravatar...
Love nurtured in heart for a distinctive individual of life gets glorified when that is expressed to that person in a soul-pleasing manner. Electing an enchanting flower bouquet or a riveting souvenir of your emotions for that special person can serve as a candied method to connect more closely with him/her. Send Flowers to India through the virtual shopping portals and transmit to the person you cherish scented fervors of dalliance. Send Cakes to India by the electronic shopping gateways and saturate the heart of the one you adore with delish glee.
Left by Monalisa Dutta on Oct 19, 2016 10:48 PM

# re: TFS 2015 Build quick Issues and Fix
Requesting Gravatar...
Your article is very well written. I like to know more about what is new and i think that we must always learn from each other. Keep it up.

Left by alifaakter on Oct 22, 2016 3:53 PM

# NSE cash tips
Requesting Gravatar...
Increase and decrease value of the stocks is common factor before prediction of the market trend and its stock prices. The rate of increase and decrease of the stock value is also termed as Volatility.and very nice key word for stock cash tips
Left by money classic research on Oct 26, 2016 3:41 PM

comments powered by Disqus

Copyright © Gaurav Bodar | Powered by: GeeksWithBlogs.net