开发者

Compiler command line for C# projects

Visual Studio shows the exact command line use to compiler and link a C++ project under Project Properties -> C/C++ -> Command Line and Linker ->Command Line, but, I was not able to find similar property page for C# project开发者_如何学运维s.

Does any know what's the best way to find out the csc.exe command line arguments used to compile a C# project


Instead of using csc.exe directly, I would recommend looking at msbuild instead. With msbuild, you just have to run msbuild yourProject.csproj to compile it.

Also, per this MSDN blog, the csc.exe command line you see in the output window isn't really being used.


In Visual Studio, go to Debug->Windows->Output. When you compile your project this window will show you the commands it is using to compile your code, including the CSC command(s).

Be sure chose the "Show output from: Build" in the option dropdown in the Output window.


See MSDN: Command-line Building With csc.exe


In Visual Studio 2010 go to

Tools->Options->Project and Solutions->Build and Run

change "MSBuild project build output verbosity" to something less filtering than Minimal (for example "Normal"). There will be a lot more talk in the Build Output window after this and you should be able to see the actual command line of how CSC was invoked.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜