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:
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!

Leave a comment