csharp-styleguide
csharp-styleguide copied to clipboard
C# 9 Top-Level Statements vs CA1812
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 https://github.com/dotnet/roslyn-analyzers/pull/4066