Skip to content

MSB4132 is emitted when a task logs errors in custom format #5203

@sae42

Description

@sae42

Steps to reproduce

This is a new issue in VS2019 16.6 Preview 1 with our custom build tasks. The issue looks to have been introduced by #4940

The issue occurs because we use our own custom log format when building within Visual Studio. We use the standard error format during command line builds so there is no problem there.
Our custom format allows us to give a richer experience navigating errors and populating the Visual Studio Error List (which allows custom columns etc). Essentially we have our own set of RegEx parse routines (similar to CanonicalError in MSBuild). Since we hook the output in IDE builds we can create the appropriate errors in the Visual Studio Error list. This is similar to the default functionality offered by VS ParseOutputStringForTaskItem However, the build tasks (which use TaskLoggingHelper.LogMessagesFromStream() ) will fail to match the format and incorrectly assume no errors were output. The MSB4132 error is then emitted.

One easy workaround/fix would have been to manually set the TaskLoggingHelper's HasLoggedErrors property, but that is unfortunately is only gettable. The only other simple fix I have is to parse the output for this new MSB4132 error and throw it away.

It would be useful if there was a way to opt out of this change in behavior. The code change itself seems to have various exemptions and I see other issues raised concerning this, so it would be good to have a simple way for any task to bypass this.

Expected behavior

Same as pre 16.6. Don't show: "...error MSB4132: The "[TaskName]" task returned false but did not log an error."

Actual behavior

"...error MSB4132: The "[TaskName]" task returned false but did not log an error."

Environment data

OS info:

Visual Studio 16.6 Preview 1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions