Visitar URL original
Enable Dotnet Code Analysis by default · Issue #5916 · NLog/NLog · GitHub
Skip to content

Enable Dotnet Code Analysis by default #5916

Open

Description

@snakefoot

Turn on dotnet code analysis in the NLog-project

    <EnableNETAnalyzers>true</EnableNETAnalyzers>
    <AnalysisLevel>latest</AnalysisLevel>
    <AnalysisMode>recommended</AnalysisMode>

Consider updating .editorconfig-file to adjust severity, when it makes sense. Example:

dotnet_diagnostic.CA1001.severity = suggestion      # CA1001: Type owns disposable field(s) but is not disposable
dotnet_diagnostic.CA1848.severity = suggestion      # CA1848: For improved performance, use the LoggerMessage delegates
dotnet_diagnostic.CA1707.severity = none            # CA1707: Remove underscores from member name
dotnet_diagnostic.IDE0130.severity = none           # IDE0130: Namespace does not match folder structure

Activity

  1. Ninja4Code commented on Aug 19, 2025

    @Ninja4Code

    I'm looking to get involved in this project. Are there any specific analyzers you want to turn on, or all of them? Then I guess based on the build and the avalanche of warning messages, etc, you want to tone down the noise. Is this for internal use or for the consumer? What's the biggest value you are trying to derive?

  2. snakefoot commented on Aug 19, 2025

    @snakefoot
    ContributorAuthor

    I have no clue what is waiting behind the door named "Dotnet Code Analysis". I just like static code analysis, and curious how it would work with the NLog-source-code.

    I was thinking one performed a local spike, and if it becomes a nightmare of false-positive, and non-fixable-issues, then I don't want it.

    The goal is seeing if it is low hanging fruit, that will not cause too much noise. Else it will just be my past-time-exercise to enable the code-analysis locally and fix the most obvious blunders. See also #4621 + #5371 + #5585 + #6007 + #6143

  3. added a commit that references this issue on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions