Back to Aspnetcore

ASP0027: Analyzer to suggest removing unnecessary public Program class declaration

aspnetcore/diagnostics/asp0027.md

latest957 B
Original Source

ASP0027: Unnecessary public Program class declaration

Value
Rule IDASP0027
CategoryUsage
Fix is breaking or non-breakingNon-breaking

Cause

An unnecessary public Program class declaration within the Program.cs file.

Rule description

Suggests to remove the unnecessary public Program class declaration as this is no longer required to make the generated Program class public in ASP.NET Core apps.

How to fix violations

To fix a violation of this rule, remove the public Program class declaration within the Program.cs file.

When to suppress warnings

The severity level of this diagnostic is Information. While the warning can be suppressed if necessary, it is recommended to remove the declaration as it is no longer required.