TFS build agent 2012 - actual msbuild command - msbuild

I have a situation where I for debugging purposes would like to "build like my build agent, but locally on my developer machine" - and for this to work I need to know the exact msbuild command that is executed on my build agent.
Unfortunately I cannot seem to find this from either of the logs available from the build view.
Anyone can help?

Changed diagnostics to "Normal" and there it was.

Related

npm fails saying "The build tools for VS2010 cannot be found"

I'm trying to install Hubot on my local machine. Going well so far until I have encountered this error. The Error is pretty clear:
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
However I am running the Hubot Initialization command Yo Hubot. And I am not able to use the /m switch. Any suggestions or advice on what I should do?
Enabling parallel build will not solve you problem, that one is just an informative message. The real problem is you don't have the Visual Studio version that was used to create one of the components Hubot needs.
Try this: npm config set msvs_version 2012 (or 2013 if you have that one).

Fail build on static code analysis warnings with msbuild and bamboo

Using bamboo v5.7 with msbuild v12, how do I fail a build if there are any static code analysis warnings? We do have our projects all set to treat all warnings as errors so the project itself doesn't build, but bamboo is not detecting this and continues on.
This seems basic, what might I be doing wrong?
The simple answer is you are doing nothing wrong, nor are you missing anything.
While it seems like basic functionality, Bamboo's MSBuild task currently doesn't support reading, reporting or failing the build on Warnings or Errors. The task only fails because MSBuild (or XBuild if you are using Mono) returns with an error code when a compiler error occurs.
Also, MSBuild doesn't actually support failing on all warnings either, as you can see here.
You have a couple options.
You can use one of the options in the referenced post
You could roll your own MSBuild log parser plugin using Atlassian's Plugin SDK.
You could make a simple script that is executed after the build, reads the logs and returns a non-zero integer if there were compiler warnings.
You can vote for the issue in the Atlassian Jira and also for the related issue for parsing build details.
Whatever your solution, I hope you share it with the many of us that have run into the same problem. It seems to be something quite common, so I was surprised there wasn't an issue already open for this in Atlassian's Jira instance
For VS 2008 and later, a new project setting was added for this. See this link.

TFS 2013 BuildAgent hanging while building solution

We have a problem with the TFS build agent intermittently hanging while building our solution. We have some custom build actions, we're using eazfuscator, and we have some post build actions as well.
So it's quite possible we are causing the problem. We've identified that the solution (filled with C# projects) starts compiling but does not finish. What we need is the log file from MSBuild/csc, but because the solution never finishes, those logs never go to the build drop.
I need help finding the log file on the build agent. Any ideas?
Thanks!!
I suggest you to copy the MSBuild command which is generated in TFS build for code compilation, run the same command on build agent server manually from command prompt. Here, you will get more details to figure out the cause build for hanging issue.

How to write an automated Build script to checkout the code from subversion and perform the build

I have to write a build script to checkout the code from subversion repository and perform the build.
I am literally a starter to scripting.
Please let me know some sample scripts that could help me, we use .net and i want to write the script in MSBuild.
What if I have to checkout the code from repository to a remote server or perform a build on the build server.
Thank You,
Rocky
You can use custom tasks and targets from http://msbuildtasks.tigris.org/
It has some stuff to work with VCS
Or you can do it manually with command line svn.exe tool something like this
<Exec Command="svn.exe" CommandArgs = " export $(SvnFullPath)/$(MSBuildProjectFile) $(MSBuildProjectDirectory)/$(MSBuildProjectFile) --force --non-interactive" ContinueOnError="True"/>
Take a look at CruiseControl.NET
Cruise control is a continuous integration server, it watches svn and does builds automatically whenever anything is checked in. It integrates with visual studio, so you don't' need to write the build scripts by hand.
When something breaks, it sends out an email.
You can also set it up to do do one off builds for releasing code. Take a look it is pretty nice.

Getting Build URi or Build number of the last build from MSBuild

I am trying to create a custom task for MSBuild so that it will send an email to the users that sais that a new version is up on the test server.
I go the email part done, what i would like to do is add the work items that are included in this build.
I tried the MSBuild extention (used to send the email) but the feature to get that info is not supporte don TFS 2005 wich is what i am using and cannot upgrade.
I was trying to use BuildStore.GetWorkItemsForBuild but i need a builduri which i cannot find a way to get.
The setup is like this, the steps to compile, build and deploy are called from a batch file as diffrent options. At the end of the deploy option, the email is sent.
Anyone can help me on this?
It's feasible but it seems your'e trying to stretch MSBuild functionality for tasks that related to build management.
Consider a solution like TeamCity that wraps for you all the build processes and manage notifications (i.e. when build has succeed or failed). It has out-of-the-box support for MSBuild.