It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo: .NET Setups

Craig Aug 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 Aug 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 Aug 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 Feb 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 ${} &quot;"/>

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Opsgenie

Introducing Postmortems for Opsgenie

When incidents happen, it is crucial to diagnose and solve the problem as fast as possible. Equally important to this, teams need a way to reflect on why the incident occurred and how they can improv...

217 views 3 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you