Migrating to .Net7

Nov 17, 2022 EST
by:   Tim Stanley

On November 8, 2022, Microsoft released .Net 7.  After getting Visual Studio Professional 17.4 installed, updating to .Net 7 was fairly painless.

Changing the obligatory TargetFramework entry in all the projects:


<TargetFramework>net7.0</TargetFramework>

Updating the package references from 6.0.0 to 7.0.0:


<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />

Updating the github action yml file to use the new dotnet version:


dotnet-version: '7.0.x'

Azure even had all the website hosting ready so I didn't have to wait for anyone to deploy .Net 7. Microsoft does list some incompatabilities in .Net 7, but it's not a long list. This has probably been the easiest migration since .net46 to .net48.

References

Related Items