C
C#2y ago
Rhaenyra

❔ How to target. Net 6 when migrating from. Net framework via Upgrade Assistant Tool?

I am using. NET upgrade assistant tool to migrate from. Net Framework MVC 4.8 to. NET 6 I uninstalled sdk for. Net 7 and left only. Net 5 and net 6 sdk but the. Net upgrade assistant still wants to target. Net 7 and after uninstalled it gave error saying "missing. Net 7 sdk" . Net 7 has been released 10 days ago and I want to target. Net 6 so i can have tutorials to follow and use nopcommerce which is compatible up to. NET 6 I am using visual studio 2022. Should I change it with visual studio 2019? Visual studio 2019 is compatible up to. NET 5 for sure and i would be OK with. NET 5 as long as it is not. Net 7
17 Replies
Cisien
Cisien2y ago
you can probably go forward with migrating to 7, then updating your csproj to use .net 6 it will probably mostly just work I think alternatively, you can use an older version of the migrator
Rhaenyra
Rhaenyra2y ago
@Cisien you mean an older version of the migrator (. Net upgrade assistant or vs code)? Because there is only one version of the. Net upgrade assistant (I'm pretty sure of this) but when I had vs 2019 the target was put as. Net 5 I want. Net 5 or. Net 6 as the e-commerce i will use it is compatible up to. Net 6
Cisien
Cisien2y ago
upgrade assistant the target is probably whatever the released sdk is there's certainly more than one version, it gets updated each .net release at least i'm just suggesting to roll with the .net 7 migration, then just change the project back to .net 6 if that's what you want the changes between 6 and 7 are minimal, you may have to fix a few things, but they should be minimal
Rhaenyra
Rhaenyra2y ago
@Cisien I don't see a way to download an older version of. Net upgrade assistant Where do I find it? How to migrate once moved to. Net 7, back to . Net 6?
Cisien
Cisien2y ago
it's a dotnet tool install no? you can pass a --version to that iirc. you can look up versions on nuget.org to migrate to 6 from 7, just change the target framework in the csproj file(s) and fix any build errors if you're going from 5 to 6, you don't need the upgrade assistant you can just change the target framework to net6.0 in the csproj update your nuget packages to their 6.0 variant as well, or the latest version that supports .net 6
Cisien
Cisien2y ago
https://learn.microsoft.com/en-us/aspnet/core/migration/50-to-60?view=aspnetcore-6.0&tabs=visual-studio for asp.net if you use that. this page will document anything you need to pay attention when updating. Note: moving from startup.cs to program.cs for your app builder isn't a requirement, neither is switching to minimal apis
Migrate from ASP.NET Core 5.0 to 6.0
Learn how to migrate an ASP.NET Core 5.0 project to ASP.NET Core 6.0.
Cisien
Cisien2y ago
https://learn.microsoft.com/en-us/dotnet/core/compatibility/6.0 is a list of breaking changes between .net 6 and 5
Breaking changes in .NET 6 - .NET
Navigate to the breaking changes in .NET 6.
Rhaenyra
Rhaenyra2y ago
@Cisien yes it's a dot net tool install --version to that iirc. (what is. Iirc?) to type on command prompt? What should I look up on nuget.org?
Cisien
Cisien2y ago
are you migrating from .net core 3.1 or .net 5?
Rhaenyra
Rhaenyra2y ago
@Cisien no, I am migrating from asp. Net mvc framework 4.8 to. Net 5 or. Net 6
Cisien
Cisien2y ago
ok
Rhaenyra
Rhaenyra2y ago
@Cisien the e-commerce needs to be re-done and I picked nopcommerce is the best solution for it and it is compatible up to. Net6
Cisien
Cisien2y ago
iirc, there was a lot of work put in in the .net 7 cycle to support asp.net to asp.net core you should probably go to 7, then downgrade to 6
Rhaenyra
Rhaenyra2y ago
@Cisien ok then but iirc stands for? What kind of iirc should I use?
Cisien
Cisien2y ago
if i recall correctly
Rhaenyra
Rhaenyra2y ago
@Cisien i am going through the upgrade to. Net 7 with. NET upgrade assistant, let's see catcomf
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.