What is the correct way to upgrade dotnet SDKs for MAUI

Tony Pitman 60 Reputation points
2024-05-16T15:01:48.6366667+00:00

Can someone tell me the proper way to upgrade .net? I have kept mine on an older version for a while now because it has been working with xcode 15.3 for me. Since it appears the issues with xcode 15.3 have been resolved in the latest version, I would like to upgrade now.

Currently my system shows this:

% dotnet sdk check

.NET SDKs:

Version Status

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

6.0.420 Patch 6.0.422 is available.

7.0.314 .NET 7.0 is going out of support soon.

8.0.101 Patch 8.0.105 is available.

`Try out the newest .NET SDK features with .NET 9.0.100-preview.3.24204.13.`

.NET Runtimes:

Name Version Status

--------------------------------------------------------------------------------- Microsoft.AspNetCore.App 6.0.28 Patch 6.0.30 is available.

Microsoft.NETCore.App 6.0.28 Patch 6.0.30 is available.

Microsoft.AspNetCore.App 7.0.17 .NET 7.0 is going out of support soon.

Microsoft.NETCore.App 7.0.17 .NET 7.0 is going out of support soon.

Microsoft.AspNetCore.App 8.0.1 Patch 8.0.5 is available.

Microsoft.NETCore.App 8.0.1 Patch 8.0.5 is available.

The last time I tried to upgrade it ended up screwing up my whole installation. I had to remove everything and install 8.0.1 from scratch. During that time I tried many things including installing the 8.0.3 version using an installer, but that just installed a separate version side by side that then I couldn't figure out how to target the new 8.0.3. Everything kept pointing to the 8.0.1 even when I would change the project file to point to the new one.

My mai use of dotnet is for MAUI applications. If there are special things that apply just to MAUI, please specify those in detail. If I will need to do anything to my projects to get them to use the new version after upgrading, please detail that as well.

I am on MacOS with Visual Studio for Mac 2022 and VSCode with the plugins. I would like to keep using VS2022 for as long as possible, so please give instructions that apply.

Thank you!!

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,031 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 58,936 Reputation points
    2024-05-16T21:37:29.57+00:00

    you need to spend some time learning about dotnet workloads:

    https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-install

    workload are sdks, and tools added to the dotnet cli tools. the Maui build chain is part of the maui workload. Visual Studio has matching workload, that supplies a GUI to config and run workload tools. the dotnet workloads are tied a dotnet version (6,7,8,9..). VS 20222 for Mac only supports up .net 8, so don't bother with net 9.

    to get to the lastest, update dotnet sdk to lastest 8 version (currently 8.0.300) and update the workloads:

    dotnet workload update

    going forward, there should be a Maui extension for VsCode to work with the maui workload tools. You may also be interested in jetbrains rider which is true IDE and supports Maui. I switched to Xcode and Swift/SwiftUI.

    when you move to a later .net version, which you will need to do when apple drops support of Xcode 15.4 code signing, you will need to install the maui workload for that version. don't upgrade Xcode until a maui workload is released that supports the upgraded Xcode.

    there were issues with maui and aspire workload manifests, but I believe fixed with the lastest versions.


2 additional answers

Sort by: Most helpful
  1. Tony Pitman 60 Reputation points
    2024-05-20T22:00:36.68+00:00

    This is after upgrading using VS2022 and letting it upgrade everything it could. What is confusing is that so much of this still says 8.0.1 or 8.0.101:

     % dotnet --info
    .NET SDK:
     Version:           8.0.101
     Commit:            6eceda187b
     Workload version:  8.0.100-manifests.4c099cbd
    
    Runtime Environment:
     OS Name:     Mac OS X
     OS Version:  14.4
     OS Platform: Darwin
     RID:         osx-arm64
     Base Path:   /usr/local/share/dotnet/sdk/8.0.101/
    
    .NET workloads installed:
     Workload version: 8.0.100-manifests.4c099cbd
     [maui-tizen]
       Installation Source: SDK 8.0.100
       Manifest Version:    8.0.21/8.0.100
       Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.21/WorkloadManifest.json
       Install Type:        FileBased
    
     [maui-maccatalyst]
       Installation Source: SDK 8.0.100
       Manifest Version:    8.0.21/8.0.100
       Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.21/WorkloadManifest.json
       Install Type:        FileBased
    
     [maui-ios]
       Installation Source: SDK 8.0.100
       Manifest Version:    8.0.21/8.0.100
       Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.21/WorkloadManifest.json
       Install Type:        FileBased
    
     [maui-android]
       Installation Source: SDK 8.0.100
       Manifest Version:    8.0.21/8.0.100
       Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.21/WorkloadManifest.json
       Install Type:        FileBased
    
    
    Host:
      Version:      8.0.1
      Architecture: arm64
      Commit:       bf5e279d92
    
    .NET SDKs installed:
      6.0.420 [/usr/local/share/dotnet/sdk]
      6.0.422 [/usr/local/share/dotnet/sdk]
      7.0.314 [/usr/local/share/dotnet/sdk]
      7.0.316 [/usr/local/share/dotnet/sdk]
      8.0.101 [/usr/local/share/dotnet/sdk]
    
    .NET runtimes installed:
      Microsoft.AspNetCore.App 6.0.28 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 6.0.30 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 7.0.17 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 7.0.19 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 6.0.28 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
      Microsoft.NETCore.App 6.0.30 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
      Microsoft.NETCore.App 7.0.17 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
      Microsoft.NETCore.App 7.0.19 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
      Microsoft.NETCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
    
    Other architectures found:
      x64   [/usr/local/share/dotnet/x64]
        registered at [/etc/dotnet/install_location_x64]
    
    Environment variables:
      Not set
    
    global.json file:
      Not found
    
    Learn more:
      https://aka.ms/dotnet/info
    
    Download .NET:
      https://aka.ms/dotnet/download
    
    
     % dotnet workload list
    
    Installed Workload Id      Manifest Version      Installation Source
    --------------------------------------------------------------------
    maui-tizen                 8.0.21/8.0.100        SDK 8.0.100
    maui-maccatalyst           8.0.21/8.0.100        SDK 8.0.100
    maui-ios                   8.0.21/8.0.100        SDK 8.0.100
    maui-android               8.0.21/8.0.100        SDK 8.0.100
    
    Use `dotnet workload search` to find additional workloads to install.
    
    
    % dotnet workload search
    
    Workload ID                 Description
    ------------------------------------------------------------------------------------
    android                     .NET SDK Workload for building Android applications.
    aspire                      .NET Aspire SDK (Preview)
    ios                         .NET SDK Workload for building iOS applications.
    maccatalyst                 .NET SDK Workload for building MacCatalyst applications.
    macos                       .NET SDK Workload for building macOS applications.
    maui                        .NET MAUI SDK for all platforms
    maui-android                .NET MAUI SDK for Android
    maui-desktop                .NET MAUI SDK for Desktop
    maui-ios                    .NET MAUI SDK for iOS
    maui-maccatalyst            .NET MAUI SDK for Mac Catalyst
    maui-mobile                 .NET MAUI SDK for Mobile
    maui-tizen                  .NET MAUI SDK for Tizen
    maui-windows                .NET MAUI SDK for Windows
    mobile-librarybuilder       workloads/mobile-librarybuilder/description
    tvos                        .NET SDK Workload for building tvOS applications.
    wasi-experimental           workloads/wasi-experimental/description
    wasm-experimental           workloads/wasm-experimental/description
    wasm-experimental-net7      .NET WebAssembly experimental tooling for net7.0
    wasm-tools                  .NET WebAssembly build tools
    wasm-tools-net6             .NET WebAssembly build tools for net6.0
    wasm-tools-net7             .NET WebAssembly build tools for net7.0
    
    

  2. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 27,596 Reputation points Microsoft Vendor
    2024-05-22T05:44:01.1766667+00:00

    Hello,


    maui-tizen 8.0.21/8.0.100 SDK 8.0.100 maui-maccatalyst 8.0.21/8.0.100 SDK 8.0.100 maui-ios 8.0.21/8.0.100 SDK 8.0.100 maui-android 8.0.21/8.0.100 SDK 8.0.100

    From this table, we can see you have installed the latest SDK, please see this NuGet-NuGet Gallery | Microsoft.NET.Sdk.Maui.Manifest-8.0.100 8.0.21

    If you want to use the latest maui control, please expand the Dependencies->net8.0-ios/android->NuGet->Microsoft.MAUI.Controls, then check if there is a warning to update to 8.0.200. If so, you can click the button and accept to install.

    For more details, you could refer to the closed known issue- KNOWN ISSUE: .NET SDK 8.0.200 Installs the Incorrect MAUI Workload Versions · Issue #20600 · dotnet/maui · GitHub

    Since it appears the issues with xcode 15.3 have been resolved in the latest version, I would like to upgrade now.

    Please keep Xcode15.2, the latest version support of Xcode with .NET 8 and MAU is still in process. See [META] Xcode 15.3 Support for .NET 8 and MAUI · Issue #21057 · dotnet/maui · GitHub

    Best Regards,

    Wenyan Zhang


    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.