---
title: "No more public partial class Program in .NET 10"
description: "If you are using API Tests with the `WebApplicationFactory` you might did something like this to have a public `Program` class:\n\n```csharp\npublic partial class Program;\n```\n\nNo more!"
updated: 2025-11-19
tags: [".NET", ".NET 10"]
canonical: "https://steven-giesel.com/blogPost/9c156006-3e54-45b9-8e0c-ea933e005983/no-more-public-partial-class-program-in-net-10"
---

# No more public partial class Program in .NET 10

If you are using API Tests with the `WebApplicationFactory` you might did something like this to have a public `Program` class:

```csharp
public partial class Program;
```

No more!

## .NET 10

If you used the `WebApplicationFactory`, you somewhere had something like: `WebApplicationFactory<Program>` and if you used top-level statements, you needed to declare the `Program` class as public partial otherwise it was internal by default.

But that changed with .NET 10. Now the `Program` class is always public, so you don't need to declare it anymore.

There is now even an analyzer [`ASP0027`](https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0027?view=aspnetcore-10.0).