Loading [MathJax]/extensions/MathMenu.js

Monday, 31 January 2022

Updating from .NET Core 3.2 to .NET 6.0

With a couple of projects on .NET Core 3.2 I thought I would update to .NET 6.0. This was pretty simple!

First, update the TargetFramework in the project references to net6.0:
     <TargetFramework>net6.0</TargetFramework>

Next, I took the opportunity to update NuGet references to the latest versions. I also cleared the NuGet cache with:
     dotnet nuget locals --clear all

At this point Visual Studio 22 Intellisense started warning that references were missing, although the code compiled properly and the Test Runner couldn't fine any of the tests. To resolve this I deleted the .vs folder and restarted.

In the SuperMarketPlanner XAML application, to fix a new compiler warning, I changed the Project SDK in the csproj from
    Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"
to 
    Project Sdk="Microsoft.NET.Sdk"

Finally, in the Azure Pipeline yaml I had to update the SDK to the following:

steps:
- task: UseDotNet@2
displayName: 'Install .NET Core 6.0.x SDK'
inputs:
version: 6.0.x
performMultiLevelLookup: true

No comments:

Post a Comment