Joshua Frank
Joshua Frank

Reputation: 13828

Is there a way to get the build command line used by Visual Studio?

I want to do a build from the command line, but I'd like to get the exact command line syntax from Visual Studio (2012), so that I don't have to manually figure out all of the flags, imports, and other parameters.

Is there a way to get Visual Studio to display this information?

Upvotes: 86

Views: 54058

Answers (4)

user7804990
user7804990

Reputation:

Though Normal setting shows some logs it isn't enough to show the actual commands run by Visual Studio. Set to Detailed to show them. Here's a screenshot of Visual Studio 2017's Options (Tools -> Options) dialog:

enter image description here

For a C++ project, it shows the compiler (cl.exe) and linker (link.exe) commands. For different languages you'd find different parts of the toolchain called e.g. csc (C#), vbc (VB), etc. You may find something like this:

enter image description here enter image description here

Upvotes: 21

Joseph Prusik
Joseph Prusik

Reputation: 1

I think the option you are looking for is the "Suppress Banner". If you switch that option off or disable it, uncheck that option, it will show all the options used at compile time. I found the option but i do not remember where it is located in the menu tree.

Upvotes: 0

Julek
Julek

Reputation: 181

The output window on verbose mode produces a lot of text. If you are interested in compilation and linking flags there is an easier way.

Just check your project configuration properties, C/C++ -> Command Line and Linker -> Command Line

enter image description here

Upvotes: 0

acfrancis
acfrancis

Reputation: 3661

When you build a project or solution in Visual Studio, the entire command line used to run the compiler (csc.exe, including switches and parameters) is displayed in the Output window. If you don't see it there, check the Verbosity level by going to:

Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity

(You may need to choose "Show all settings") options in toolbar -- finding projects and solution in options

It has to be set to "Normal" or higher. Check this question and answer for more details:

To see all command line on output window while compiling

Upvotes: 77

Related Questions