Hide console output from msbuild task

I am running this msbuild script from the command line (other details skipped)

<MSBuild Projects ="@(ProjectsToBuild)"
             ContinueOnError ="false"
             Properties="Configuration=$(Configuration)">

      

How can I hide my output if I have no compilation errors?

+3


source to share


2 answers


There are no parameters you can add to a specific target in msbuild to build it without the command output. But you can move the call to the second target and then call the target by executing msbuild and using the / noconsolelogger flag:



<Exec Command="MSBuild $(MSBuildProjectDirectory)\$(MsBuildThisFile) /t:TargetToExecute /nologo /noconsolelogger"/> 

      

+2


source


msbuild's output (mostly) comes from Logger objects. These objects are extensible; you can provide your own implementation, or you can use any of the built-in loggers.

If you see console output from msbuild, you see output from the built-in console logger. You can disable console logging using a command line parameter /noconsolelogger

.



Even with this option set, you will still see a couple of lines of output: a startup message that includes the program name and a copyright message. You can disable this output with the option /nologo

.

+1


source







All Articles