我怎么知道 Visual Studio 用于编译 c# 解决方案的特定命令? [英] How could I know the specific command visual studio use to compile a c# solution?
问题描述
在单个 C++ 文件的属性对话框中,我可以看到编译单个 C++ 文件的命令.
In property dialog for a single c++ file, I could see the command to compile the the single c++ file.
但是对于 c# 项目,我什至无法编译单个 cs 文件.有什么方法可以知道 VS 中用于生成最终程序集的确切命令行是什么?
But for c# project, I could not even compile a single cs file. Are there any means to know what's the exact command line used in VS to produce the final assembly?
推荐答案
我想声明的第一件事是您能够编译单个 C# 代码,但是您需要将代码放到一个单独的项目,或通过命令行构建它,请参见此处:如何c# 只编译一个文件?
First thing I would like to declare is you are able to compile a single C# code, but you need to put the code to a separate project, or build it via command line, see here: How to compile just one file in c#?
对于您的第二个问题,您似乎无法访问或修改 VS 中用于编译 C# 代码的命令.但是,您可以通过 Property(右键单击您的项目名称)->Build
检查所有构建选项,并在 Property->Build Event 上指定您自定义的构建前和构建后事件代码>.
For your second question, it seems you are unable to access or modify the command used in VS to compile C# code. However, you could check all your building options via Property (right click on your project name)->Build
, and specify your customized pre and post building events on Property->Build Event
.
作为最后的手段,打开 MSBuild 日志记录以查看一些构建详细信息.您可以参考此页面和此页面.
As the last resort, turn on MSBuild logging to see some building details. You can refer to this page and this page.
这篇关于我怎么知道 Visual Studio 用于编译 c# 解决方案的特定命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!