Skip to content

Conversation

@yanrez
Copy link
Contributor

@yanrez yanrez commented Sep 28, 2023

Include optional logger name in console output if it fails to load during initialization.

Help identifying the logger that has issue

Fixes #9289

Context

Currently if failure happens during initialization for optional logger, the message like this is printed:

The specified logger could not be created and will not be used. The given assembly name was invalid.

It's very hard to debug since it doesn't give any hints which logger is having problems

Changes Made

Testing

Notes

…wn during initialization. Help identifying the logger that has issue
@rainersigwald
Copy link
Member

Looks like Name is not a good field to use here--it's empty in the tests we're running which seem pretty straightforward

❯ dotnet S:\msbuild\artifacts\bin\bootstrap\net8.0\MSBuild\MSBuild.dll -logger:",asdf.dll,IsOptional" .\MSBuild.Dev.slnf

MSBuild version 17.9.0-dev-23479-01+3aa07b74d for .NET
The specified logger "" could not be created and will not be used. Could not load file or assembly 'asdf.dll, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

@AR-May AR-May self-requested a review October 3, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The specified logger could not be created and will not be used. The given assembly name was invalid.

5 participants