You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LoggerMessage - SYSLIB1008 should have a better message #52221
I made the mistake of adding static to my LoggerMessage method (through copy-paste mistake) and I wanted to use my instance ILogger _logger field, so I didn't have an ILogger in the method parameters.
I got this error message:
Severity Code Description Project File Line Suppression State
Error SYSLIB1008 One of the arguments to a logging method must implement the Microsoft.Extensions.Logging.ILogger interface Microsoft.Extensions.Diagnostics.HealthChecks C:\git\aspnetcore\src\HealthChecks\HealthChecks\src\HealthCheckPublisherHostedService.cs 207
This message didn't help me right away because I didn't want to pass an ILogger in the arguments. So it took me a while to realize the method was static and that was the issue.
We should update this message to also include that the method is static.
Activity
[-]SYSLIB1008 should have a better message[/-][+]LoggerMessage - SYSLIB1008 should have a better message[/+]Improve logging source generator error messages
- Fixes race with captive scoped services