-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual Studio Online Build Fails GetTeamBuildNumber Task failed unexpectedly. #7
Comments
This looks interesting: http://msdn.microsoft.com/en-us/library/hh850448.aspx Seem you can get the build number by using a built in environment variable (Maybe VS2013 only), I'm going to see if I can make this work, please stop me if I'm barking up the wrong tree :-) |
I've found a solution: If I amend my MSBuild arguments to the following:
This works fine with TFS Online, thanks goes to whoever wrote the target conditions which checks for this value and only runs the GetTeamBuildNumber task if it's empty. |
On closure inspection I can see that the TeamBuildNumber.targets is designed to cater for this problem but something is broken as it doesn't return the building number from the line
My suggestion works but I guess it's a workaround for now. |
Hi John, Thanks for reporting this issue and your great feedback. This project was written for VS2012 on-premise installations, which is why you have run into this issue. In VS2012 the TF_BUILD_BUILDNUMBER variable didn't exist, which is why we needed the targets for getting the build number from TFS' API. The workaround you have provided is perfect! I will see if I can make the MSBuild targets use TF_BUILD_BUILDNUMBER if it is available and get back to you. Cheers! |
No problem, glad I could help. |
For those wrestling with Hosted TFS in Visual Studio online, the variable is BUILD_BUILDNUMBER. Per https://msdn.microsoft.com/Library/vs/alm/Build/scripts/variables |
Why I try to use this excellent package with TFS Online I get this error.
C:\a\src.deploy\Variables.targets (30): The "GetTeamBuildNumber" task failed unexpectedly.
Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access https://xxxxx.visualstudio.com/defaultcollection.
I'm wondering if the account that the build agent is running with needs another permission that it doesn't get with the online version by default.
I'm queuing the build using the TFS Owners account (mine).
I'm not the strongest MSBuild guy so any debugging steps / suggestion would be most welcome.
The text was updated successfully, but these errors were encountered: