2013年8月27日

on
參考檔管理與csc.exe命令列執行寫法:
一般執行命令列編譯寫法,
csc /target:exe /reference:mscorlib.dll /out:HelloWorld.exe  HelloWorld.cs
而若參考檔很多,此寫法不是很適合。
因此現在我們使用延伸檔案方式來處理:
一、參考檔管理,新增文字檔:helloworld.rsp,內容如下:
/target:exe
/referente:mscorlib.dll
/out:HelloWorld.exe
二、csc.exe命令列執行寫法:
csc @helloworld.rsp helloworld.cs

延伸閱讀:
Compiling C# code from the command line - LA.NET [EN]
http://msmvps.com/blogs/luisabreu/archive/2007/08/31/compiling-c-code-from-de-code-line.aspx

0 意見:

張貼留言

注意:只有此網誌的成員可以留言。