Geekus Con Livus

Malcolm Anderson's home for Geeks With Lives
posts - 92 , comments - 87 , trackbacks - 23

Using NantContrib's msbuild task

I'm in the process of trying to make a copy of tree surgeon that does a couple of different things.  (If you don't know what tree surgeon is and you're a dotnet developer, I can not say enough good things about it, go, run, don't walk, get it)


One: I want to implement Jean-Paul Boodhoo's version of the Model-View-Presenter framework which he presented in DNRTV episode 14

Two: I want to provide a Console, a WinForm, and an ASP.Net front end.

Three: I want to upgrade treesurgeon to 2005.


In light of that, the first thing I had to do was to get the source code for treesurgeon and then upgrade it to VS2005.  No big deal, just open it with 2005, up pops the wizard, it converts, again, no big deal.


My next issue was to try out the go.bat.


Uh-oh, NAnt doesn't do 2005 solutions, but nant contrib does "msbuild" tasks.  Unfortunately, the nant contrib documentation assumes that you know msbuild, and doesn't explain how to chose which configuration to build with.  Thankfully the blogosphere provided the answer with google pointing me over to Brig Lamoreaux's blog where he off handedly gave me what I needed to convert the nant task (Thanks Brig)


Here's the original target

<target name="compile" description="Compiles using the AutomatedDebug Configuration">
      <solution solutionfile="src\TreeSurgeon.sln" configuration="AutomatedDebug" />

Here's the final version of the target.

<target name="compile" description="Compiles using the AutomatedDebug Configuration">
      <loadtasks assembly="tools/nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll" />
      <msbuild project="src\TreeSurgeon.sln">
            <property name="Configuration" value="AutomatedDebug"/>

It was the "property" setting for "Configuration" that I would have eventually come to after studying the msbuild documentation, which I don't really want to do, so again, a big "Thanks Brig" for saving me the time.

Print | posted on Saturday, February 3, 2007 4:47 PM |



# re: Using NantContrib's msbuild task

OH, THANK you so much. If I only had the 9 hours of my life back searching for this solution.!
6/15/2007 11:02 AM | Larry Richardson

# re: Using NantContrib's msbuild task

Hi, It was really a worth wile time spending adn it had given me a good opportunity to complete my Task on time, thanks and keep blogging for a great cause
7/9/2007 3:29 AM | Seshadri

# re: Using NantContrib's msbuild task

This would be SO much easier if the NAnt dudes finally got the <solution> task up-to-date!!!
7/3/2009 5:10 PM | Ralph

# re: Using NantContrib's msbuild task

I had the same issue. This wrapped it up quick. Thank you for posting!
1/23/2012 11:28 PM | Jeff Smith
Post A Comment

Powered by: