Question

I have a Visual Studio 2005 solution (.sln) with a mix of .NET and C++ projects. What is the best way to generate the .build file I will need to run my build process with NAnt. I'm new to using NAnt, and I'm not sure how to set it up. Will I have to update the .build file manually every time there is a new source file in any of the projects? Is there a tool that will generate the files for NAnt from the .sln and studio project files?

Was it helpful?

Solution

There is no way that I know of to generate a .build file from an sln. There should be decent examples of .build files at http://nant.sourceforge.net.

That being said there are two ways to build a .sln file from NAnt.

  • checkout nant.sourceforge.net or nant-contrib for built in or extended tasks to do this
  • use an "exec" task to shell out msbuild.exe to build the sln.

msbuild.exe has native support for sln files. You can build an sln file from the command line as follows:

msbuild.exe /p:Configuration=Debug /t:rebuild MySolution.sln

msbuild.exe can be found in your .NET Framework directory (e.g. C:\WINDOWS\Microsoft.NET\Framework\vX.XX.XXXX)

OTHER TIPS

With nant you will have to use the EXEC command to shell out to msbuild for the solution files.

Others have been experiencing the same issues.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top