Nant: Using Visual Studio to build a website and including its output

|
If you have an ASP.net web site (Visual Studio 2005 heritage from when project files disappeared), you might be using Visual Studio to build it into an MSI Installer in your CruiseControl.NET build server. If you're not, lucky you! :)

If you are, it's useful to be able to see Visual Studio's build output in the build log CC shows you, so try this:

  <target name="build.devenv90.website">
    <exec program="${DevEnvExe.90}">
      <arg value='/Rebuild release "C:\BuildServer\VSS\WebSite\Website.sln" /Out "c:\buildserver\vss\website\vs_errors.txt"' />
    </exec>
    <trycatch>
      <try>
        <loadfile 
          file='C:\buildserver\vss\WebSite\vs_errors.txt'          
          property='VisualStudio.Output'
        />
        <echo message='${VisualStudio.Output}' />
      </try>
      <catch>
        <echo message='*** Visual Studio Output Failed ***' />
      </catch>
    </trycatch>
  </target>
The trick there is using the loadfile task to pull Visual Studio's output into a property and then echo-ing it. Nothing more exciting than that really!

About this Entry

This page contains a single entry by Robert Wray published on January 30, 2009 1:03 PM.

.net - Implementing Sorting (IComparable<T>) was the previous entry in this blog.

Three Stupid Mistakes is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 5.04