MSBuild 和 IgnoreStandardErrorWarningFormat

标签 msbuild

我正在尝试编写一个 MSBuild 项目,它将使用 doxygen 生成 html 文档。除了 example 之外,我在网上找不到任何相关信息。 ,这似乎不完整;它不解析 doxygen 警告。

我发现MSBuild's Exec任务具有 IgnoreStandardErrorWarningFormat 和 CustomWarningRegularExpression 等参数。什么是“标准错误/警告格式”以及这些属性中允许使用什么类型的 RE?

编辑:啊,“Microsoft Build Engine 内部”错误地将其描述为 .NET 3.5 中的属性,实际上它来自 4。对我来说没有用...

最佳答案

标准的 msbuild 错误/警告格式描述为 here .

简单来说,格式是:

MSBuild recognizes error messages and warnings that have been specially formatted by many command line tools that typically write to the console. For instance, take a look at the following error messages - they are all properly formatted to be MSBuild and Visual Studio friendly.

Main.cs(17,20): warning CS0168: The variable 'foo' is declared but never used 
C:\dir1\foo.resx(2) : error BC30188: Declaration expected.
cl : Command line warning D4024 : unrecognized source file type 'foo.cs', object file assumed
error CS0006: Metadata file 'System.dll' could not be found.

These messages confirm to special format that is shown below, and comprise 5 parts - the order of these parts are important and should not change:

Canonical Errors/Warnings

Origin (Required)

Origin can be blank. If present, the origin is usually a tool name, like 'cl' in one of the examples. But it could also be a file name, like 'Main.cs' shown in another example. If it is a file name, then it must be an absolute or a relative file name, followed by an optional parenthesized line/column information in one of the following forms:

(line) or (line-line) or (line-col) or (line,col-col) or (line,col,line,col)

Subcategory (Optional)

Subcategory is used to classify the category itself further, and should not be localized.

Category (Required)

Category must be either 'error' or 'warning'. Case does not matter. Like origin, category must not be localized.

Code (Required)

Code identifies an application specific error code / warning code. Code must not be localized and it must not contain spaces.

Text (Optional)

User friendly text that explains the error, and must be localized if you cater to multiple locales.

关于MSBuild 和 IgnoreStandardErrorWarningFormat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3441452/

相关文章:

jenkins - 在命令行中构建 UWP 应用程序(使用 MSBUILD)

msbuild - 旧项目格式忽略 PackageReference 条件

msbuild - 当我运行 msbuild 时,它会调用 aspnet_compiler,但不会编译我的站点

MSBUILDEMITSOLUTION 不适用于 .NET 4?

msbuild - 如何从 MSBuild 中的文件动态加载属性

msbuild - 您可以在MSBuild中执行不区分大小写的字符串比较吗?

msbuild - TFS 构建服务器比本地机器花费更多的时间来构建

visual-c++ - 如何使用MSBuild定位v110平台工具集?

.net - 在 teamcity 中使用 msbuild 部署到远程服务器

.net - SonarQube MSBuild Scanner 不会从分析中排除文件