Skip to content

Commit c1b3233

Browse files
Merge pull request #35061 from benhopkinstech/35037
Added ASP0027 documentation
2 parents e886892 + 152f8b0 commit c1b3233

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

aspnetcore/diagnostics/asp0027.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: "ASP0027: Analyzer to suggest removing unnecessary public Program class declaration"
3+
ms.date: 03/25/2025
4+
description: "Learn about analysis rule ASP0027: Unnecessary public Program class declaration"
5+
author: benhopkinstech
6+
monikerRange: '>= aspnetcore-10.0'
7+
ms.author: riande
8+
uid: diagnostics/asp0027
9+
---
10+
# ASP0027: Unnecessary `public Program` class declaration"
11+
12+
| | Value |
13+
| - | - |
14+
| **Rule ID** | ASP0027 |
15+
| **Category** | Usage |
16+
| **Fix is breaking or non-breaking** | Non-breaking |
17+
18+
## Cause
19+
20+
An unnecessary `public Program` class declaration within the `Program.cs` file.
21+
22+
## Rule description
23+
24+
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.
25+
26+
## How to fix violations
27+
28+
To fix a violation of this rule, remove the `public Program` class declaration within the `Program.cs` file.
29+
30+
## When to suppress warnings
31+
32+
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.

aspnetcore/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,8 @@ items:
14251425
uid: diagnostics/asp0025
14261426
- name: ASP0026
14271427
uid: diagnostics/asp0026
1428+
- name: ASP0027
1429+
uid: diagnostics/asp0027
14281430
- name: ASP0028
14291431
uid: diagnostics/asp0028
14301432
- name: BL0001

0 commit comments

Comments
 (0)