Search code examples
msbuildmsbuild-taskmsbuildextensionpack

hide console output from msbuild task


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 ?


Solution

  • 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"/>