Skip to content

Commit 378bfcc

Browse files
committed
WN: P1
1 parent 737a1ea commit 378bfcc

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
## Better support for testing apps with top-level statements
22

3-
https://github.com/dotnet/aspnetcore/pull/58199
4-
https://github.com/dotnet/aspnetcore/pull/58482
3+
.NET 10 now has better support for testing apps that use top-level statements. Previously developers had to manually add `public partial class Program` to the `Program.cs` file so that the test project could reference the `Program class`. This is because the top-level statement feature in C# 9 generated a `Program class` that was declared as internal.
54

6-
.NET 10 now has better support for testing apps that use top-level statements.
7-
Previously developers had to manually add `public partial class Program` to the
8-
Program.cs file so that the test project could reference the Program class.
9-
This is because the top-level statement feature in C# 9 generated a Program class
10-
that was declared as internal.
5+
In .NET 10, a source generator is used to generate the `public partial class Program` declaration if the programmer did not declare it explicitly. In addition, an analyzer was added to detect when `public partial class Program` is declared explicitly and advise the developer to remove it.
116

12-
In .NET 10, a source generator is used to generate the `public partial class Program`
13-
declaration if the programmer did not declare it explicitly. In addition, an analyzer
14-
was added to detect when `public partial class Program` is declared explicitly and
15-
advise the developer to remove it.
7+
![Image](https://github.com/user-attachments/assets/a37f0c81-a58a-453f-8da5-fa49356ca180)
168

17-
![Image](https://github.com/user-attachments/assets/a37f0c81-a58a-453f-8da5-fa49356ca180)
9+
The following PRs contribited to this feature:
10+
11+
* [PR 58199](https://github.com/dotnet/aspnetcore/pull/58199)
12+
* [PR 58482](https://github.com/dotnet/aspnetcore/pull/58482)

0 commit comments

Comments
 (0)