Skip to content

[LiveLogger] Many exceptions are thrown from the logger #8458

Closed
@ladipro

Description

@ladipro

Issue Description

Throwing and catching exceptions has perf implications and generally makes debugging harder.

Steps to Reproduce

Run msbuild /ll under a debugger.

Expected Behavior

No exceptions.

Actual Behavior

Many occurrences of:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Build.Logging.LiveLogger.ProjectNode.Log() in C:\src\msbuild\src\MSBuild\LiveLogger\ProjectNode.cs:line 156

With an occasional:

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at Microsoft.Build.Logging.LiveLogger.TerminalBuffer.Render() in C:\src\msbuild\src\MSBuild\LiveLogger\TerminalBuffer.cs:line 145

Analysis

No response

Versions & Configurations

Commit dfd8f41

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions