Simplified Solution File Format
From sln to slnx: the new slnx format is easier to read and maintain, removes redundant information, and makes the project structure clearer.
dotnet sln migrate
Also update the sln files referenced in slnf files to slnx files.
Upgrading the Target Framework to .NET 10
In the project files, change the target framework from net9.0 to net10.0:
<TargetFramework>net10.0</TargetFramework>
Upgrading Aspire to 13.0.0
In the project files, update the Aspire package version to 13.0.0
- <Project Sdk="Microsoft.NET.Sdk">
+ <Project Sdk="Aspire.AppHost.Sdk/13.0.0">
- <Sdk Name="Aspire.AppHost.Sdk" Version="9.5.2" />
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>net9.0</TargetFramework>
+ <TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
- <IsAspireHost>true</IsAspireHost>
<UserSecretsId>0afc20a6-cd99-4bf7-aae1-1359b0d45189</UserSecretsId>
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="Aspire.Hosting.AppHost" Version="9.5.2" />
+ <!-- Aspire.Hosting.AppHost is now included automatically by the SDK -->
</ItemGroup>
</Project>
Updating Central Package Management Packages in Directory.Packages.props to the Latest
List all packages that need updating
dotnet list package --outdated
Upgrading Swagger to the Microsoft.AspNetCore.OpenApi Version
The previous approach was to use Swashbuckle.AspNetCore to generate OpenAPI documents in JSON format, and then use Swagger UI to provide an interactive API documentation interface.
The Swashbuckle.AspNetCore package includes both the ability to generate OpenAPI documents and to serve Swagger UI.
Now Microsoft officially provides the Microsoft.AspNetCore.OpenApi package to generate OpenAPI documents, tightly integrated with the ASP.NET Core framework. The UI can be provided by other tools, such as Redoc or a custom front end, or you can continue to use Swagger UI as the front-end presentation layer.
Test Visibility
Remove the following code snippet:
public partial class Program { }
Integrating MAUI into the Aspire Project
Add the following to the project file to enable MAUI support:
var mauiapp = builder.AddMauiProject("hybridapp", "../HelloWorld.HybridApp/HelloWorld.HybridApp.csproj");
mauiapp.AddWindowsDevice().WithReference(apiService).WaitFor(apiService);
mauiapp.AddMacCatalystDevice().WithReference(apiService).WaitFor(apiService);
mauiapp.AddiOSSimulator().WithReference(apiService).WaitFor(apiService);
mauiapp.AddAndroidEmulator().WithReference(apiService).WaitFor(apiService);
Fixing Some Breaking Changes
- Remove the
Aspire.Hosting.AppHostpackage, since it is now included automatically by the SDK. - Check and update any code that uses deprecated APIs, referring to the Aspire 13.0 release notes for guidance.
- Test the application to make sure everything works, and resolve any issues caused by the upgrade.