Как подавить все предупреждения с помощью MSBuild
Как я могу подавить все предупреждения (или, по крайней мере, как можно больше, поскольку префикс MSB не может быть подавлен Как подавить определенное предупреждение MSBuild)?
Ответы
Ответ 1
Лучший способ - исправить проблемы, вызывающие предупреждения.
Если вы должны игнорировать предупреждения (например, вы унаследовали проект с таким количеством, что вы не видите дерево для деревьев), вы можете попробовать изменить свойство WarningLevel, http://msdn.microsoft.com/en-us/library/13b90fz7.aspx
Ответ 2
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.
Ответ 3
Если вы хотите отключить MSB3270, то вы можете установить только в файле проекта
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>