-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the bug
The CA1873 analyzer enabled by default in .NET 10 is flagging the log call in the below minimal repro for a logging parameter that is not expensive. The examples in the docs make sense, however this does not. Is this intended behaviour and all log messages should now be wrapped in an if (logger.IsEnabled(...)) block?
To Reproduce
Minimal repro: https://github.com/joshuahills/ca1873-false-positive
- Clone repo
- Build solution
- Observe build error
Exceptions (if any)
n/a
Further technical details
details of dotnet --info
.NET SDK: Version: 10.0.100 Commit: b0f34d51fc Workload version: 10.0.100-manifests.5fb86115 MSBuild version: 18.0.2+b0f34d51f
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100\
Microsoft Visual Studio Professional
Channel: Insiders
Version: Insiders [11218.70]