My Maui .NET8 workloads on Windows 11 got trashed, so now I am following the troubleshooting guide to try to completely remove MAUI and get a fresh start:
https://learn.microsoft.com/en-us/dotnet/maui/troubleshooting?view=net-maui-8.0
I reached the point where, having deleted workloads and sdk installers, we are told to use reg query to list remaining .msi files that need to be uninstalled:
reg query HKLM\SOFTWARE\Microsoft\Windows\currentversion\uninstall\ -s -f manifest
This brought up ten entries:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\currentversion\uninstall\{3ACEC80F-60DF-459A-B4FE-079248AFBDF8}
InstallSource REG_SZ C:\ProgramData\dotnet\workloads\microsoft.net.sdk.ios.manifest-8.0.100.msi.arm64\17.0.8490\
DisplayName REG_SZ Microsoft.NET.Sdk.iOS.Manifest-8.0.100 (arm64)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\currentversion\uninstall\{580344D0-D2F4-4040-AF23-A4A5537A2317}
InstallSource REG_SZ C:\ProgramData\dotnet\workloads\microsoft.net.sdk.tvos.manifest-8.0.100.msi.arm64\17.0.8490\
DisplayName REG_SZ Microsoft.NET.Sdk.tvOS.Manifest-8.0.100 (arm64)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\currentversion\uninstall\{886369C4-3176-4986-99A2-A2F2D3076AC8}
InstallSource REG_SZ C:\ProgramData\dotnet\workloads\microsoft.net.sdk.macos.manifest-8.0.100.msi.arm64\14.0.8490\
DisplayName REG_SZ Microsoft.NET.Sdk.macOS.Manifest-8.0.100 (arm64)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\currentversion\uninstall\{96863CEC-64BA-46DD-834B-88532D98AAE6}
InstallSource REG_SZ C:\ProgramData\dotnet\workloads\microsoft.net.sdk.maccatalyst.manifest-8.0.100.msi.arm64\17.0.8490\
DisplayName REG_SZ Microsoft.NET.Sdk.MacCatalyst.Manifest-8.0.100 (arm64)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\currentversion\uninstall\{D2EFF3EE-756E-47E6-AF62-C01ECE07795B}
InstallSource REG_SZ C:\ProgramData\dotnet\workloads\microsoft.net.sdk.android.manifest-8.0.100.msi.arm64\34.0.52\
DisplayName REG_SZ Microsoft.NET.Sdk.Android.Manifest-8.0.100 (arm64)
We are then instructed to uninstall each with a command of the form
msiexec /x {3ACEC80F-60DF-459A-B4FE-079248AFBDF8} /q IGNOREDEPENDENCIES=ALL
However, msiexec rejects this as incorrect syntax. So, after reading the msiexec docs (which seem to be out of date, by the way), plus lots of googling, I tried
msiexec /uninstall /package {3ACEC80F-60DF-459A-B4FE-079248AFBDF8} IGNOREDEPENDENCIES=ALL
This ran immediately to completion with no output, but re-running the reg query showed that nothing had happened; all ten entries remained.
So my question is, what do I do now? Is there other syntax I can use with msiexec? Otherwise, is it safe to manually delete the registry entries, such as
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\currentversion\uninstall\{3ACEC80F-60DF-459A-B4FE-079248AFBDF8}
and then delete the files, such as C:\ProgramData\dotnet\workloads\microsoft.net.sdk.ios.manifest-8.0.100.msi.arm64 ? Or is it enough to just uninstall Visual Studio and reinstall?
msiexec /x {GUID}
is the correct syntax to uninstall a package by its ProductCode
. The longer syntax was added later but it is the same thing with more typing.
Note: if you are using PowerShell curly braces can be interpreted, so you need to escape them. Or if you're not comfortable with PowerShell, use plain old cmd
.
The /q
is why you don't see any UI. Try using /qb
instead to see a progress bar for the uninstall with "quiet basic UI" instead of totally quiet "no UI".
The IGNOREALLDEPENDENCIES
is a property that is custom to those installation packages. It does not have a Windows Installer specific behavior.
Finally, add /l*v log.txt
to get a log file that will tell you more information after the progress bar is completed.
msiexec /x {GUID} IGNOREDEPENDENCIES=ALL /qb /l*v log.txt
Aside:
(which seem to be out of date, by the way)
This is a strange comment that doesn't seem to be very useful. The documentation for the command-line for the Windows Installer is very much correct. The /?
switch to msiexec is also pretty good, no internet access required.
PPS: Randomly deleting the files and registry keys is a good way to leave bits and pieces of software all over your machine. That will make it harder to uninstall and install later versions of said software. You probably regularly see comments that say something like, "Modify the registry only if you know what you are doing." Those warnings are provided for good reason.