-1

i have a following xml file which said to be as

<target name="run-command">
  <exec program="D:\ib2cmd.bat" basedir=".">
  </exec>
</target>

and placed in the project file

then i set the environment variable for nant-0.92-bin path in system variables.

finally i called from c# through

System.Diagnostics.Process.Start("nant.exe -buildfile: d:xxx/xx/xxx.xml");

while iam running this i got error as

INVALID INPUT FILE PATH

i do not know where i went wrong

waiting for your valuable suggestions and comments

GowthamanSS
  • 1,434
  • 4
  • 33
  • 58

2 Answers2

1

You can use this code - based on ProcessStartInfo

        ProcessStartInfo startInfo = new ProcessStartInfo("nant.exe");
        startInfo.Arguments = "/-buildfile  \"d:\\xxx\\xx\\xxx.xml\"";
        Process.Start(startInfo);

Lanuch Bat

 <target name="run-command">
   <exec program="..." basedir=".">
     <arg value="" />
   </exec>
 </target>
Aghilas Yakoub
  • 28,516
  • 5
  • 46
  • 51
0

I better to use:

System.Diagnostics.Process.Start("nant.exe -buildfile: \"d:\\xxx\\xx\\xxx.xml\"");

I think that the command line is not getting the path correctly because is not in windows format.

Amedio
  • 895
  • 6
  • 13