Migrating from .NET 8 to .NET 9 Print

  • 0

Overview

.NET 9 is a Standard Term Support (STS) release with enhanced performance and new features. If you need long-term stability, consider staying on .NET 8 LTS or waiting for .NET 10 LTS.

What is New in .NET 9?

  • Performance: Further optimizations in JIT and GC
  • Blazor: Improved static rendering and hydration
  • Minimal APIs: Enhanced OpenAPI support
  • LINQ: New methods like CountBy, Index

Step 1: Update Target Framework

Edit your .csproj file:

<!-- Before -->
<TargetFramework>net8.0</TargetFramework>

<!-- After -->
<TargetFramework>net9.0</TargetFramework>

Step 2: Update NuGet Packages

Update all Microsoft.* packages to 9.x:

dotnet outdated --upgrade

Step 3: Key Breaking Changes

  • Obsolete APIs: Some APIs marked obsolete in .NET 8 may be removed
  • Behavioral Changes: Review Microsoft's breaking changes documentation
  • Package Updates: Third-party packages may need updates

Step 4: Blazor Updates

If using Blazor, review new features:

  • Improved static SSR (Server-Side Rendering)
  • Enhanced form handling
  • Better hydration performance

Step 5: Test and Build

dotnet clean
dotnet build
dotnet test
dotnet run

Step 6: Update Plesk Configuration

  1. Log in to Plesk control panel
  2. Navigate to Websites & Domains → your domain
  3. Click Hosting Settings
  4. Set .NET Core Version to 9.0.x
  5. Save changes

Step 7: Publish and Deploy

dotnet publish -c Release -o ./publish

Deploy via Web Deploy or FTP to your Plesk hosting.

Considerations

  • .NET 9 is STS - supported for 18 months
  • For production apps, .NET 8 LTS may be more appropriate
  • Plan migration to .NET 10 LTS when available

Was this answer helpful?

« Back