Upgrading C# NET Core 7.0 to 8.0 in Visual Studio IDE - Guidance and Suggesgtions

Todd Albers 1 Reputation point
2023-12-01T19:07:07.91+00:00

Long story short

First and foremost:

  • You might have Visual Studio 2022 IDE installed and think that meets the requirement for .NET 8 when it might not.
  • It might not be the most recent version (as of time of this post) of VS 2022 which is required.
  • BE SURE TO UPGRADE YOUR VISUAL STUDIO 2022 TO THE MOST CURRENT VERSION OF VS 2022.
  • Make sure it is 17.8 or later.
  • Your Visual Studio 2022 IDE must be version 17.8+.
    • Visual Studio 2022 versions, 17.0 - 17.7 do not support .NET 8.

----------------------------------------------------------------------------------------------------

If you do this and still run into problems, continue below.

This was an upgrade of a .NET Maui Project and the .NET Core 7.0 to 8.0. I am providing this post to see if we (or Microsoft) might be able provide an easier migration path. I think there are some things that I needed to do for the upgrade to be successful that are not laid out anywhere together. So, I am listing them here. Hopefully this enables Microsoft or other developers in finding these things in one place. Right now, you have stumble onto each one.

Below is a rough outline of what I did to upgrade successfully and some comments along the way. Some of the steps may be out of order and some may not be necessary. But, doing these got me there.

I think the biggest issue is Step 3 below. : "Targeting net8.0 is officially supported in Visual Studio 17.8+ only."

So - NET 8.0 does not work Visual Studio 2022 versions, 17.0, 17.1, 17.2, 17.3, 17.4, 17.5, 17.6, or 17.7!!! I suspect that a lot of problems for developers trying to migrate to .NET 8 are because they see that they have Visual Studio 2022 installed but don't realize that they don't have the most recent version of VS 2022 installed. Microsoft should consider releasing Visual Studio 2022 17.9 as Visual Studio 2023 18.0 instead. This would bring more attention to the need for upgrading Visual Studio.



STEP 1 Upgrade to .NET 8.0

First, I followed these articles below and installed .NET 8, actually thinking that it might be this easy. (It's not)

It seemed like it might be as easy as these two articles suggest.

https://devblogs.microsoft.com/dotnet/announcing-asp-net-core-in-dotnet-8/

https://devblogs.microsoft.com/dotnet/announcing-dotnet-8/ However after installing .NET 8, it still didnt work



STEP 2 Install and Run the .NET Upgrade Assistant Extension

Running this made a lot of changes that I thought, "OK, now the migration will be complete and successful. (It wasn't)

Install and run the upgrade assistant.

https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview

https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-install#install-the-visual-studio-extension



STEP 3 Upgrade Visual Studio

I think this is the biggest step that might get overlooked. I overlooked it initially.

Microsoft should probably put a check in both Steps 1 and 2 above for this.

The articles under steps 1 and 2 should bring attention to the following stated on the page below: "Targeting net8.0 is officially supported in Visual Studio 17.8+ only."

So - NET 8.0 does not work Visual Studio 2022 versions, 17.0, 17.1, 17.2, 17.3, 17.4, 17.5, 17.6, or 17.7!!!

I suspect that a lot of problems for developers trying to migrate to .NET 8 are because they see that they have Visual Studio 2022 installed but don't realize that they don't have the most recent version of VS 2022 installed.

If you go to this link below, it takes you to a table.

https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs#targeting-and-support-rules

In the table at the link above scan down the last two columns that have the following 2 titles:

Max TargetFramework in minimum

Visual Studio version Max TargetFramework in dotnet

Note where .NET 8.0 shows up and compare that with column 3: "Minimum Visual Studio version" The point is that you might be on Visual Studio 2022 but not realize that you're version of Visual Studio 2022 does not support .NET 8.0. I don't know why this information is not provided under the release notes for Visual Studio or .NET 8.0

So, Upgrade your Visual Studio IDE. https://learn.microsoft.com/en-us/visualstudio/install/update-visual-studio?view=vs-2022



STEP 4 Install the .NET SDK for Visual Studio for .NET 8.0

There is some functionality that is actually in this SDK for .NET 8.0 that you might think comes in .NET 8.0. I think this is optional for some. You may not need it. I needed it. https://dotnet.microsoft.com/en-us/download/visual-studio-sdks



STEP 5 Make sure you rebooted your computer when you needed to in steps above. Some of the steps above require a reboot. If you didn't reboot yet, do that now.



STEP 6 Make sure your Nuget packages are up to date.

In Visual Studio, go to Tools \ NuGet Package Manager \ Manage Nuget Packages for Solutions.

Click on Updates. If you see any showing here update those.

https://learn.microsoft.com/en-us/nuget/consume-packages/reinstalling-and-updating-packages


Finally, I was still getting this error: "resource mipmap/appicon not found" I posted a work-around that resolved this issue.

https://learn.microsoft.com/en-us/answers/questions/511521/resource-mipmap-myicon-not-found-how-to-fix-this

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,685 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,969 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,370 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Karen Payne MVP 35,201 Reputation points
    2023-12-01T19:34:12.9066667+00:00

    Unsure what you mean by : stop putting markdown changes where there aren't any. Markdown is a language for files with .md extensions.


  2. Anna Xiu-MSFT 26,566 Reputation points Microsoft Vendor
    2023-12-04T13:10:22.5633333+00:00

    Hi @Todd Albers

    Welcome to Microsoft Q&A! 

    To upgrade your .NET MAUI project from .NET 7 to .NET 8, you can also refer to the document:

    • Install .NET 8 and the .NET MAUI workload with Visual Studio 17.8+, or with the standalone installer and dotnet workload install maui command.
    • Change your target framework (TFM) references from net7.0-* to net8.0-*. If you are using a TFM like net7.0-ios13.6, be sure to match the shipping version of that platform or just remove the platform version (i.e. 13.6).
    • delete your bin and obj folders

    Microsoft should consider releasing Visual Studio 2022 17.9 as Visual Studio 2023 18.0 instead. This would bring more attention to the need for upgrading Visual Studio. 

    If you have any suggestion, you can directly report it to product team by selecting “Help” menu > Send Feedback.  After reporting it, you can copy the feedback link and share it here.

    Thanks for helping us building a better Visual Studio! 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.