From e99e04d9506d7b3441568a4772f01c9dcc22aaf0 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:41:53 -1000 Subject: [PATCH] Update testAppsTopLevel.md (#34763) * Update testAppsTopLevel.md Fixes #34725 * Update aspnetcore/release-notes/aspnetcore-10/includes/testAppsTopLevel.md * Update link for 'internal' keyword reference --- .../release-notes/aspnetcore-10/includes/testAppsTopLevel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/release-notes/aspnetcore-10/includes/testAppsTopLevel.md b/aspnetcore/release-notes/aspnetcore-10/includes/testAppsTopLevel.md index ecc5d78dd1e0..5e14953d3b2a 100644 --- a/aspnetcore/release-notes/aspnetcore-10/includes/testAppsTopLevel.md +++ b/aspnetcore/release-notes/aspnetcore-10/includes/testAppsTopLevel.md @@ -1,8 +1,8 @@ ### Better support for testing apps with top-level statements -.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. +.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). -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. +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. ![Image](https://github.com/user-attachments/assets/a37f0c81-a58a-453f-8da5-fa49356ca180)