Skip to content

C# 9 Top-Level Statements vs CA1812 #64

@Everest2020

Description

@Everest2020

After using the C# 9 feature Top-Level Statements, there is an error.

error CA1812: < Program >$ is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it static (Shared in Visual Basic).

It is already fixed in the official Roslyn-analyzers repo. see dotnet/roslyn-analyzers#4066

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions