How to write a batch program that compiles a C # console application2011-03-22 18:14 dc Poison Mushroom | Browse 579 times
Recently read a tutorial online, is learning C #, but my machine is not loaded with VS, so want to write a batch to compile, because each time I want to change the directory, and then copy the path, then compile, output, a special waste of time, so specifically to help the netizen, hope to help
Share to:
report | 2011-03-22 19:17#快乐假期, the wisdom to accompany #The questioner is adopted by
I don't know if you've ever used ant, you can create an ant script to build your application.
If you are not familiar with, and do not want to write, I introduce you a visual programming of the Ant script software (Download the 30-day use of license), you may be mainly used in the Ant script exec command.
Http://www.placidsystems.com/virtualant/Default.aspx
Ask:
Sorry, I am a novice, you said in the inside of something I do not understand eh
have been learning three layers of architecture, just don't know how to make up, because not in depth to understand some of the previous learning things, not skilled, do not know how to compile
Chase Answer:
1, this ..... Please refer to http://ant.apache.org/
2, can also write their own batch (BAT), but maintenance is more troublesome.
3, this method for you should be easier to start, that is to write a C # program, let him help you complete, in order to maintain the convenience, you can write your configuration information into a file (the format can be XML or other). By the time, simply run the program you wrote, you can automatically help you compile your program.
I suggest you choose a third way above.
Ask:
My idea is the second and 3rd combination, but I don't seem to
Chase Answer:
No problem, check the documentation.
Http://msdn.microsoft.com/zh-cn/library/system.diagnostics.process%28v=VS.71%29.aspx
You can call your external application through the process and let it compile your C # code.
-
Questioner evaluation
-
Thank you.
How to write a batch program that compiles a C # console application