dotnet / project-system-tools

Tools for working with the C#/VB/F# project system.
MIT License
272 stars 42 forks source link

Don't modify log verbosity/events when not logging #444

Closed drewnoakes closed 2 years ago

drewnoakes commented 2 years ago

We recently uncovered a bug in MSBuild that only reproduced if you had the Project System Tools extension installed, regardless of whether build logging was enabled in this extension.

That bug highlighted how this extension would request diagnostic-level logging and several build events unconditionally. Therefore, simply installing this extension would hurt your build performance.

Logger verbosity and build events are queried for every build. Therefore we can return minimal values for each when we are not actually logging.