MSBuild and Visual Studio Known Error Message Formats

When a tool is executed that outputs some text, MSBuild will examine the text for errors and warnings. There is a known format that many tools use to report these messages. By default MSBuild will examine the text, and report errors and/or warnings based on the output. This behavior can be changed, or disabled, by using these parameters on the Exec task: IgnoreStandardErrorWarningFormat, CustomErrorRegularExpression, and CustomWarningRegularExpression. Most of the content here is based on an entry from the MSBuild Team blog, and is used with their permission.

Take a look at the following four messages, which are all properly formatted and will be recognized by MSBuild and Visual Studio.

Main.cs(17,20): ...

Get Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.