azure-webjobs-sdk icon indicating copy to clipboard operation
azure-webjobs-sdk copied to clipboard

Microsoft.Azure.WebJobs suppresses analyzers related to logging

Open ThatRendle opened this issue 1 year ago • 0 comments

Adding a reference to Microsoft.Azure.WebJobs suppresses analyzers related to logging, e.g. CA1727, CA2253, CA2254

Repro steps

Provide the steps required to reproduce the problem

  1. Create a project with a reference to Microsoft.Extensions.Logging 6.0.0
  2. Add a call to a logger with an interpolated string
  3. Add <WarningsAsErrors>CA2254</WarningsAsErrors> to the project file
  4. Try to build, get error
  5. Add reference to Microsoft.Azure.WebJobs
  6. Try to build, error is ignored

Repro repo: https://github.com/markrendle/LoggingAnalyzerRepro

Expected behavior

Using a NuGet package shouldn't disable code analyzers.

Actual behavior

Using Microsoft.Azure.WebJobs disables some code analyzers.

Known workarounds

None

Related information

Provide any related information

  • 3.0.37 (latest)

ThatRendle avatar Jul 03 '23 11:07 ThatRendle