3

I am running this msbuild scriplet from command line (other details ommited)

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

How can I hide its output if I don't have any errors on compile ?

nerlijma
  • 935
  • 1
  • 9
  • 24

2 Answers2

3

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

<Exec Command="MSBuild $(MSBuildProjectDirectory)\$(MsBuildThisFile) /t:TargetToExecute /nologo /noconsolelogger"/> 
Kevin R
  • 46
  • 3
3

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

If you're seeing console output from msbuild, you're seeing output from the built-in console logger. You can turn off the console logger using the /noconsolelogger command-line option.

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

MikeB
  • 1,452
  • 14
  • 28