How to run ant commands from C#?
I want开发者_运维问答 to excute ANT commands from C# application , may I use ExecuteCommandSync( ..)
, to excute cmd commands, but I need to navigate inside project directory to execute some ant commands , how may I do that to navigate a directory path using C# to excute such commands
c:/dir1/testdir/myproject ant compile
Look at the System.Diagnostics.Process class. It allows you to specify such things as WorkingDirectory and path to the executable (in the process.StartInfo property). It has an Exited event you can subscribe to in case you need to chain commands.
精彩评论