Skip to content

Instantly share code, notes, and snippets.

@PureWeen
Forked from jonathanpeppers/dotnet-workloads.md
Created April 12, 2023 21:42
Show Gist options
  • Select an option

  • Save PureWeen/8052cdd4584b57d03b8b7a9aabd60a6e to your computer and use it in GitHub Desktop.

Select an option

Save PureWeen/8052cdd4584b57d03b8b7a9aabd60a6e to your computer and use it in GitHub Desktop.

Revisions

  1. @jonathanpeppers jonathanpeppers revised this gist Jun 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dotnet-workloads.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ Things also can get "weird" if you command-line `dotnet workload install` on top
    Here are steps to get to a clean state:

    1. If you ever used `dotnet workload install`, run `dotnet workload uninstall maui`.
    2. Uninstall any standalone installers from Control Panel, etc.
    2. Uninstall any standalone .NET SDK installers from `Control Panel`. These are the ones that do not say "from Visual Studio".
    3. In every instance of Visual Studio, uninstall all Mobile/MAUI and .NET/Desktop "Visual Studio" workloads.

    Next, let's check if there are additional `.msi`'s hanging around:
  2. @jonathanpeppers jonathanpeppers revised this gist Jun 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dotnet-workloads.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ To install the `maui` workload, you have two options:
    1. `dotnet workload install` commands
    2. Visual Studio on Windows can install `.msi` files for each workload pack. Note that the concept of a "Visual Studio workload" is different than a ".NET workload".

    VS for Mac's installer and updater use `dotnet workload install` commands. It's also considerably
    VS for Mac's installer and updater use `dotnet workload install` commands. It's considerably simpler to get a Mac machine to a clean state.

    # Mac

  3. @jonathanpeppers jonathanpeppers created this gist Jun 17, 2022.
    66 changes: 66 additions & 0 deletions dotnet-workloads.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,66 @@
    # .NET Workload Troubleshooting

    To install the `maui` workload, you have two options:

    1. `dotnet workload install` commands
    2. Visual Studio on Windows can install `.msi` files for each workload pack. Note that the concept of a "Visual Studio workload" is different than a ".NET workload".

    VS for Mac's installer and updater use `dotnet workload install` commands. It's also considerably

    # Mac

    Since, `.pkg` files don't really have a way to "uninstall" the simplest way to get your machine in a clean state is to simply delete folders:

    ```bash
    rm -r ~/.dotnet/
    sudo rm -r /usr/local/share/dotnet/
    ```

    After doing this, install the .NET SDK of your choice and run `dotnet workload install maui` for a clean install.

    # Windows

    This is where things get... *complicated*.

    The .NET SDK has two types of installers:

    * `Microsoft .NET SDK 6.0.300 from Visual Studio`
    * `Microsoft .NET SDK 6.0.300` - standalone

    Things also can get "weird" if you command-line `dotnet workload install` on top of packages installed by Visual Studio.

    Here are steps to get to a clean state:

    1. If you ever used `dotnet workload install`, run `dotnet workload uninstall maui`.
    2. Uninstall any standalone installers from Control Panel, etc.
    3. In every instance of Visual Studio, uninstall all Mobile/MAUI and .NET/Desktop "Visual Studio" workloads.

    Next, let's check if there are additional `.msi`'s hanging around:

    ```cmd
    reg query HKLM\SOFTWARE\Microsoft\Windows\currentversion\uninstall\ -s -f manifest
    ```

    If you get results after uninstalling, like:

    ```
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\currentversion\uninstall\{EEC1BB5F-3391-43C2-810E-42D78ADF3140}
    InstallSource REG_SZ C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.MacCatalyst.Manifest-6.0.300,version=125.179.40883,chip=x64,productarch=neutral\
    DisplayName REG_SZ Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.300
    ```

    Then you can grab the GUID and uninstall this package via:

    ```
    msiexec /x {EEC1BB5F-3391-43C2-810E-42D78ADF3140} /q IGNOREDEPENDENCIES=ALL
    ```

    After the `reg query` command returns no results, and all .NET 6+ SDKs are uninstalled, you might consider deleting:

    * `C:\Program Files\dotnet\sdk-manifests`
    * `C:\Program Files\dotnet\metadata`
    * `C:\Program Files\dotnet\packs`
    * `C:\Program Files\dotnet\library-packs`
    * `C:\Program Files\dotnet\template-packs`
    * `C:\Program Files\dotnet\sdk\6.*` or 7, etc.
    * `C:\Program Files\dotnet\host\fxr\6.*` or 7, etc.