views:

233

answers:

1

i have a build file with nant now all i need to do is execute it with command prompt using c# i tried the below but i am not able to build it .. pls help me its urgent.. thnaks in advance

System.Diagnostics.Process.Start("exe -buildfile:d:\buildfile.build);

and when i am runing through cmd prompt directly it is working

+1  A: 

Have you setup nant as an environment variable?

System.Diagnostics.Process.Start("nant.exe -buildfile:d:\buildfile.build);
Chris McKelt
no can u tell me how to set the environment i am just specifing the nant path like "D:\\nant\\bin\\Nant.exe /build D:\\\buildfile.build
happy
its should work if you are specifying the full path -- whats the error message you are getting?Update your PATH environment variable to include <nant dir>\bin (for my setup, that's C:\nant-0.86\bin). see this article for managing environment variables -- http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/environment_variables.mspx?mfr=true
Chris McKelt
you could also rename you buildfile.build to be default build -- then you do not have to specifiy -buildfile:d:\buildfile.build Just run NANT in the directory
Chris McKelt