Skip to content

Commit dbef916

Browse files
Merge pull request #34762 from dotnet/main
Merge to Live
2 parents b8f1d50 + e99e04d commit dbef916

File tree

3 files changed

+365
-37
lines changed

3 files changed

+365
-37
lines changed

aspnetcore/release-notes/aspnetcore-10/includes/testAppsTopLevel.md

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

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.
3+
.NET 10 now has better support for testing apps that use [top-level statements](/dotnet/csharp/fundamentals/program-structure/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`. `public partial class Program` was required because the top-level statement feature in C# 9 generated a `Program class` that was declared as [internal](/dotnet/csharp/language-reference/keywords/internal).
44

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.
5+
In .NET 10, a [source generator](/shows/on-dotnet/c-source-generators) is used to generate the `public partial class Program` declaration if the programmer didn't declare it explicitly. Additionally, an analyzer was added to detect when `public partial class Program` is declared explicitly and advise the developer to remove it.
66

77
![Image](https://github.com/user-attachments/assets/a37f0c81-a58a-453f-8da5-fa49356ca180)
88

0 commit comments

Comments
 (0)