Tags: .NET 5 .NET 6 Azure Optimizely CMS

Upgrade from .NET 5 to .NET 6

Why should you upgrade from .NET 5 to .NET 6?

All of the above?

Two dice showing six dots

How do you upgrade?

Change your project file from this...

<Project Sdk="Microsoft.NET.Sdk.Web">
    <PropertyGroup>
        <TargetFramework>net5.0</TargetFramework>
    </PropertyGroup>	
</Project>

...to this...

<Project Sdk="Microsoft.NET.Sdk.Web">
    <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>
    </PropertyGroup>	
</Project>

...simply update the number 5 to 6.

What about hosting?

If you are running in Optimizely DXP, the environment should recognize the .NET 6 on your next deploy, and the appropriate container is used.

If you're hosting in Azure, you'll need to update the Major version for your WebApp in the configuration section.

Azure portal configuration for .NET major version

That's it!

Found this post helpful? Help keep this blog ad-free by buying me a coffee! ☕