Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate from .net standard to .net 6/8 using the upgrade tool

I tried upgrading a .NET standard project to a .NET 6 or 8 project using this upgrade assistant tool:

https://dotnet.microsoft.com/en-us/platform/upgrade-assistant/tutorial/install-upgrade-assistant

I ran the tool as the steps describe (installing it, using upgrade-assistant analyze with the project csproj path and then upgrade-assistant upgrade with the path), but after it was done, the project still remains with a target framework of .net standard 2.0.

Is there something else needs to be done in order to upgrade the framework?

like image 444
Yonatan Nir Avatar asked Sep 10 '25 15:09

Yonatan Nir


2 Answers

I eventually simply edited the project file directly. To convert it to .net 6 or 8 all you need to do is change the <TargetFramework> to be like this:

<TargetFramework>net6.0</TargetFramework>

 or like this:

<TargetFramework>net8.0</TargetFramework>

It's a 3 seconds work so no need for any tools

like image 185
Yonatan Nir Avatar answered Sep 13 '25 06:09

Yonatan Nir


.NET standard works parallelly. That means you would have to update to .NET standard 2.1 if you need it for other old framework projects. Otherwise create new libraries in .NET 6 and migrate your code. According to microsoft: https://dotnet.microsoft.com/en-us/platform/dotnet-standard, .NET 6 supports .NET Standard 2.1. Future versions of .NET will also support .NET Standard 2.1 and earlier versions.

like image 27
mike Avatar answered Sep 13 '25 05:09

mike