Hello,
Could someone explain the differences between .NET SDK, .NET Workloads, and the MAUI NuGets and how they are related to each other?
The .NET SDK is a set of libraries and tools that developers use to create .NET applications and libraries. .NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML. MAUI is a part of .NET, and it's a .NET solution for building native cross-platform apps.
Please see
.NET SDK overview - .NET | Microsoft Learn
What is .NET MAUI? - .NET MAUI | Microsoft Learn
SDK workloads (maui
, maui-mobile
, and maui-desktop
workloads) are to enable specific developer scenarios on top of the .NET SDK you’ve installed. And the workload will acquire and install all the required SDKs for building .NET MAUI applications.
Please see Announcing .NET MAUI Preview 6 - .NET Blog (microsoft.com) (This article was old)
If you create a MAUI project by MAUI template in VS, it will install multiple NuGet packages automatically. Microsoft.Maui.Controls
package lets you get started with .NET MAUI. Microsoft.MauiCompatibility
package allows for easier migration from Xamarin.Forms.
For instance, if I update from SDK 8.0.100 to 8.0.300, should I also update the other components?
Yes. You can open the terminal in VS, then run `dotnet workload update`
to get the latest workload.
(If you install/update the latest VS, the SDK and the workload will update automatically)
And you can expand the Dependencies->net8.0-ios(or android/maccatalyst/windows)->NuGet->Microsoft.MAUI.Controls, then right-click the package to check if it can be updated.
Update
This still holds the other way round? I.e. if I update the NuGets, should I update the workload as well? I mean:
In a given major SDK release (let's say the .NET 8 release), there are multiple minor releases of said SDK, but also multiple workloads updates and MAUI NuGet packages updates.
Typically, let's say in a new machine, I install the latest major, stable, SDK version, then install the workloads for said SDK. From that moment on I keep updating the NuGets but not the SDKs nor the workloads. When does it become mandatory to update the workloads again? From what I understand, of course once .NET 9 is the next stable one, one is suppesed to install the .NET 9 SDK (and its workloads) to be able to use the version 9 of the MAUI NuGets. But, do you also get any benefit when building a MAUI app to, let's say, upgrade the SDK + workloads for a fixed MAUI NuGet packages (for instance you have the 8.0.61 release installed and you upgrade the SDK/Workloads)?
When to update depends on your needs, we recommended that you use the latest version. Some newer versions of the NuGet packages may produce errors if you attempt to install them on older workload and/or SDK versions.
If you install VS, the SDK and workload are already hosted. When you update VS, they will be update as well. As of .NET 8, MAUI is delivered via NuGet packages. This allows for upgrading or downgrading MAUI while keeping the rest of .NET current.
(It means that if you just update the NuGet, MAUI part will be update but other .NET part won't)
It also allows testing preview and nightly builds of MAUI more easily to see if bugs have been fixed.
Please see
https://github.com/dotnet/maui/wiki/Nightly-Builds
.NET MAUI Version Pinning & Nightly Build Integration
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.