简体   繁体   English

从Visual Studio构建时如何查看CSC.EXE(或VBC.EXE)参数

[英]How to see CSC.EXE (or VBC.EXE) parameters when building from Visual Studio

Is there a way to see what the CSC (or VBC) parameters are, when building an application using the Visual Studio? 在使用Visual Studio构建应用程序时,有没有办法查看CSC(或VBC)参数是什么?

Visual Studio calls CSC.exe/VBC.exe behind the scenes. Visual Studio在后台调用CSC.exe / VBC.exe。 I want to know if there is a way to see that call. 我想知道是否有办法看到那个电话。

I need this info to replicate the equivalent Build script using the command line. 我需要此信息来使用命令行复制等效的Build脚本。

I set the different levels of verbosity for the build, still I do not see any CSC.EXE call in the output window. 我为构建设置了不同级别的详细程度,但仍然没有在输出窗口中看到任何CSC.EXE调用。

I'm really surprised why Microsoft did not put an easy way to see the underlying CSC command. 我真的很惊讶为什么微软没有简单的方法来查看底层的CSC命令。

AJ if I go through your steps I get: AJ,如果我完成你的步骤,我得到: 在此输入图像描述

I do not see any reference to CSC 我没有看到任何对CSC的提及


OK here is how I resolved this: 好的,这是我如何解决这个问题:

First I went to tools and options and set the verbosity to detail. 首先,我使用了工具和选项,并将详细程度设置为详细信息。 (After this point still build output was empty). (此后仍然构建输出为空)。

Then I got Service pack for VS2010. 然后我得到了VS2010的Service Pack。

I also had similar issue for Visual Studio 2012 I had to get "update 4" to see the logs and CSC.EXE ion the output. 我也有类似的Visual Studio 2012问题我必须得到“更新4”才能看到日志和CSC.EXE离开输出。

I think what you're looking for can be set up in your VS environment options. 我想你可以在你的VS环境选项中设置你想要的东西。 Under the Tools menu, select "Options," then "Projects and Solutions." 在“工具”菜单下,选择“选项”,然后选择“项目和解决方案”。 Make sure "Show Output window when build starts" is checked. 确保选中“构建开始时显示输出窗口”。

显示输出

Then, under "Projects and Solutions," select "Build and Run" and change the level of "MSBuild project build output verbosity." 然后,在“项目和解决方案”下,选择“构建并运行”并更改“MSBuild项目构建输出详细程度”的级别。 I changed it to "Detailed" as an experiment, but you can fiddle with the levels to get what you want. 我把它改为“详细”作为一个实验,但你可以调整水平以获得你想要的东西。

输出详细程度

Then, when you build/rebuild your solution, the easiest thing to do is to place your cursor in the build output window and search for "csc" (or "vbc" for VB). 然后,当您构建/重建解决方案时,最简单的方法是将光标放在构建输出窗口中并搜索“csc”(或VB的“vbc”)。 You should be able to see the entire command line call to the compiler. 您应该能够看到对编译器的整个命令行调用。

构建输出

EDIT 编辑
To answer your comment, change the "Show output from" drop-down option at the top of the output window from "Debug" to "Build" and do a build/rebuild without running the application in debug mode. 要回答您的注释,请将输出窗口顶部的“显示输出”下拉选项从“调试”更改为“构建”,然后执行构建/重建,而无需在调试模式下运行应用程序。

显示输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM