My project has an MSBuild target which runs a tool which generated some files:
<Exec Command="$(MyTool) @(Content)"
ConsoleToMSBuild="true"
IgnoreExitCode="False"
LogStandardErrorAsError="true" />
If the tool detects some error in its inputs (the @(Content)
files), it outputs the error to standard error. This makes MSBuild to fail the build, and Visual Studio to show this text in the error list - all of which is great!
Now, the tool also knows the exact file&line where the error is, and I want the error list to show that, and that double-click would lead to the file. If the tool were an MSBuild Task rather than a standalone exe, I could call TaskLoggingHelper.LogError(..., file, lineNumber, ...)
. How can I accomplish the same with a standalone exe tools? Do I need to write a wrapper task which parses the tool's error? Is there such a task already available?