开发者

How to run ant commands from C#?

开发者 https://www.devze.com 2023-03-21 22:54 出处:网络
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 comma

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消