Link to home
Start Free TrialLog in
Avatar of jasondole
jasondole

asked on

How do i Call MSBuild.exe with nant to build a solution file for visual studio 2005

I am using nant to do our automated builds and having a problem getting it to work with MSbuild and visual studio 2005 solutions. I am getting an error that says the return code was 1 when i tried this command below in my nant build file
<exec program="c:\windows\microsoft.net\framework\v2.0.50727\MSBuild.exe" commandline="/t:rebuild ${root}Web\mysite.solution.sln" />
does anybody have any ideas?
ASKER CERTIFIED SOLUTION
Avatar of Sammy
Sammy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Melih SARICA
try to use the full path of ur solution file intead of root parameter
Avatar of jasondole
jasondole

ASKER

My program is still crapping out when i try to build, it says
MSBUILD: error MSB1009: Project file does not exist
switch: D:\devbuilds\Web\mysite.solution.sln
external program failed: c:\windows\microsoft.net\framework\v2.0.50727\MSBuild.exe (return code was 1)

Here is the command line i had based off the article you gave me:
<exec program="c:\windows\microsoft.net\framework\v2.0.50727\MSBuild.exe" verbose="true" failonerror="false" commandline="/t:rebuild d:\devbuilds\Web\mysite.solution.sln" />

Any ideas why this is?
Thanks again for all your help!
Ok, i used aspnet_compiler.exe and it seems to work with as a compiler but now i am getting errors dealing with missing assemblies, would using aspnet_compiler.exe cause these issues?
here is my call to the aspnet_compiler.exe call i have in nant.
<exec program="c:\windows\microsoft.net\framework\v2.0.50727\aspnet_compiler.exe"  commandline="-v /HBR -p d:\devbuilds\mysite\webapp -c errorstack" verbose="true" failonerror="false" workingdir="d:\devbuilds\mysite\"

my working directory is different becuase that is the directory where my refenernces are as the target directory is the main project, please let me know if you have any suggestions or comments, thanks for your help!
the compiler needs the project to have all assemblies.
check your classes for imports or using statements

all my classes have the correct assemblies, i migrated the solution file from vs2003 to vs2005 and it worked fine when i used to compile it in vs2003 but once i switched over to vs2005, i got this error so i think i am missing something in my compile statement but i am unsure, that is just a thought...