Joseph Gordon
Joseph Gordon

Reputation: 2382

How to suppress all warnings using MSBuild

How would I suppress all warnings (or at least as many as possible since those prefixed with MSB cannot be suppressed How to suppress specific MSBuild warning)?

Upvotes: 34

Views: 32945

Answers (4)

fusion27
fusion27

Reputation: 2646

In Jenkins

  • Happened upon this Googling "how to suppress MSBuild warnings in Jenkins"
  • So much noise like the following in our console output, couldn't find the meat
    Missing XML comment for publicly visible type or member
    
  • Inherited Jenkins on a Windows server

  1. Manage Jenkins > Global Tool Configuration > MSBuild
  2. Add /clp:ErrorsOnly to the Default parameters enter image description here

Upvotes: 2

Stanislav Berkov
Stanislav Berkov

Reputation: 6287

If you would like to suppress MSB3270 only then you can set in project file just

<PropertyGroup>
  <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
    None
  </ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>

Upvotes: 5

Stephen
Stephen

Reputation: 961

msbuild /clp:ErrorsOnly

  /consoleloggerparameters:
                     Parameters to console logger. (Short form: /clp)
                     The available parameters are:
                        PerformanceSummary--Show time spent in tasks, targets
                            and projects.
                        Summary--Show error and warning summary at the end.
                        NoSummary--Don't show error and warning summary at the
                            end.
                        **ErrorsOnly--Show only errors.**
                        WarningsOnly--Show only warnings.
                        NoItemAndPropertyList--Don't show list of items and
                            properties at the start of each project build.
                        ShowCommandLine--Show TaskCommandLineEvent messages
                        ShowTimestamp--Display the Timestamp as a prefix to any
                            message.
                        ShowEventId--Show eventId for started events, finished
                            events, and messages
                        ForceNoAlign--Does not align the text to the size of
                            the console buffer
                        DisableMPLogging-- Disable the multiprocessor
                            logging style of output when running in
                            non-multiprocessor mode.
                        EnableMPLogging--Enable the multiprocessor logging
                            style even when running in non-multiprocessor
                            mode. This logging style is on by default.
                        Verbosity--overrides the /verbosity setting for this
                            logger.

Upvotes: 86

Paul Butcher
Paul Butcher

Reputation: 6956

The best way is to fix the issues that are causing the warnings.

If you must ignore the warnings (e.g. you have inherited a project with so many that you can't see the wood for the trees), you could try changing the WarningLevel property, http://msdn.microsoft.com/en-us/library/13b90fz7.aspx

Upvotes: 12

Related Questions