Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bamboo: .NET Setups

Craig August 31, 2011

Are there any samples around of different approaches to configuring a .NET build process using Visual Studio as the builder?

I've been trying multiple jobs in a stage, multiple stages in a job, and dealing with having lots of different test projects within a solution. So it would be useful if there was a guide to good/best practice in this area.

2 answers

1 accepted

2 votes
Answer accepted
Bernard O'Flynn August 31, 2011

Not that I'm aware of. We have also been using Bamboo for .Net builds. Our solutions are either a web site and many business layer projects, or a web service with associated business layer projects.

We have set up the web site and web services as web applications in VS. That way we can use the publish target to put everything into a zip and use the generated deploy.cmd to deploy to IIS.

So our first stage does our builds - up to 3 different configurations, debug(dev), test(qa) and release(live). Each build is a job in that stage so they can be done in parallel. Each job has a task that versions the dlls based on the version in JIRA and then creates shared artifacts so we can use them later on in the process without having to check everything out of SVN again. So we have 3 packages and then all the test dlls and test config files (vsmdi, etc.)

In the next stage, we run all our unit tests and code coverage (using NCover) by re-using the debug package.

In the next stage we deploy to IIS by calling the project.deploy.cmd that VS spits out when you call msbuild webproject.csproj /T:Publish

We then have another stage which is a manual stage which deploys to test. That way we can do some manual testing before we deploy to QA. Once QA is happy, we have another manual stage to deploy to live.

Hope that helps?

Craig August 31, 2011

Thanks Bernard. I was starting to head down the artifacts as inter-stage communication route but wasn't sure on whether I was about to waste a lot of time :)

1 vote
Brandon Bird February 22, 2012

I found the following ANT exec line to be effective. It calls the visual studio environment setup batch file, then invokes the solution build. If the compile/build fails, exec is returned a nonzero exit code, so ANT can act appropriately. Build output is written to a file, useful for diagnostics.

<exec executable="cmd.exe" failonerror="true">
   <!-- execute a command which sets up and invokes the visual studio solution builder -->
   <arg value="/s /c &quot; call &quot;%VS100COMNTOOLS%/vsvars32.bat&quot; &amp;&amp; devenv.exe ${gui.solution.file} /rebuild Debug /Out ${gui.build.logfile} &quot;"/>
</exec>



Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events