Msbuild from the command line does not display Csc warnings and output

When I create my solution from the command line using msbuild , I do not get any output from the csharp (Csc) compiler, as visual studio does.

For example, if I create my solution in Visual Studio, I get:

warning CS0162: Unreachable code detected

When I build from the command line using msbuild I don't get any warning (I want the warning to appear!)

Edit: / verbosity flag doesn't do the trick

+4
source share
2 answers

Are you sure you are building the same configuration? Typically, Visual Studio will configure the default debugging configuration. On the other hand, MsBuild will build your Release configuration by default. Make sure that warning levels are set at the same level for both configurations in your project settings.

+3
source

I think you might need an argument to output verbosity ...

From MSDN Link :

Displays this amount of information in the build log. Individual loggers display events based on the level of detail. The logger can also be configured to ignore the details parameter.

Available levels of detail: q [uiet], m [inimal], n [ormal], d [etailed] and diag [nostick] ./ v are also acceptable. For instance:

/ detail: calm

+1
source

Source: https://habr.com/ru/post/1334791/


All Articles