Redth / dotnet-maui-check

.NET MAUI Check tool
MIT License
479 stars 79 forks source link

How to uninstall? #52

Closed ivanjx closed 3 years ago

ivanjx commented 3 years ago

It seems that maui workloads is breaking my visual studio installation. This happens after i installed dotnet 6 preview 5. My other computer is just fine after i installed the preview 5 without maui workloads installed. Projects wont load (even non maui projects like blazor, wpf, asp net core, etc) with this error: error : The project file cannot be opened. The NuGet-based SDK resolver failed to run because NuGet assemblies could not be located. Check your installation of MSBuild or set the environment variable "MSBUILD_NUGET_PATH" to the folder that contains the required NuGet assemblies. Could not find file 'C:\Program Files\dotnet\sdk-manifests\6.0.100\Microsoft.NET.Workload.Android\WorkloadManifest.json'. When i tried to update the tool i got this:

 dotnet tool update --global Redth.Net.Maui.Check

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.100-preview.5.21302.13

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
C:\Users\t\AppData\Local\Temp\vcwbd54v.uva\restore.csproj(5,3): warning MSB4243: The NuGet-based SDK resolver failed to run because NuGet assemblies could not be located.  Check your installation of MSBuild or set the environment variable "MSBUILD_NUGET_PATH" to the folder that contains the required NuGet assemblies. Could not find file 'C:\Program Files\dotnet\sdk-manifests\6.0.100\Microsoft.NET.Workload.Android\WorkloadManifest.json'.
C:\Program Files\dotnet\sdk\6.0.100-preview.5.21302.13\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props(14,3): warning MSB4243: The NuGet-based SDK resolver failed to run because NuGet assemblies could not be located.  Check your installation of MSBuild or set the environment variable "MSBUILD_NUGET_PATH" to the folder that contains the required NuGet assemblies. Could not find file 'C:\Program Files\dotnet\sdk-manifests\6.0.100\Microsoft.NET.Workload.Android\WorkloadManifest.json'.
C:\Program Files\dotnet\sdk\6.0.100-preview.5.21302.13\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props(14,38): error MSB4236: The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found. [C:\Users\t\AppData\Local\Temp\vcwbd54v.uva\restore.csproj]
Tool 'redth.net.maui.check' failed to update due to the following:
The tool package could not be restored.
Tool 'redth.net.maui.check' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool

Tried to repair my visual studio via the installer with no luck. Is there anything else i can do? Otherwise i have to fully reinstall my visual studio installation. Any help is appreciated. Thanks.

czirok commented 3 years ago

I found a workaround.

I deleted all preview files and folders in the "\Program Files\dotnet *" folder.

IMPORTANT! Only the preview files and folders!

Then, "dotnet new" and all "dotnet *" and "dotnet tool install -g Redth.Net.Maui.Check" command worked again.

¤ .NET MAUI Check v0.5.6.0 ¤ ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────This tool will attempt to evaluate your .NET MAUI development environment. If problems are detected, this tool may offer the option to try and fix them for you, or suggest a way to fix them yourself.

Thanks for choosing .NET MAUI! ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────» Synchronizing configuration... ok » Scheduling appointments... ok

OpenJDK 11.0 Checkup...

  • 11.0.10 (C:\Program Files\Microsoft\jdk-11.0.10.9-hotspot\bin..)
  • 1.8.0-25 (C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25)
  • 12.0.2 (C:\Users\Czirok\AppData\Local\jdk-12.0.2)

Visual Studio 16.10.0 Checkup...

  • 17.0.0-pre.1.0 - C:\Program Files\Microsoft Visual Studio\2022\Preview
  • 16.10.2 - C:\Program Files (x86)\Microsoft Visual Studio\2019\Community

Android SDK Checkup...

  • emulator (30.1.5)
  • build-tools;30.0.2 (30.0.2)
  • platforms;android-30 (3)
  • system-images;android-30;google_apis;x86_64 (9)
  • platform-tools (30.0.5)

Android Emulator Checkup...

  • Emulator: pixel_2_pie_90-_api_28 found.

.NET SDK Checkup...

  • 5.0.301 - C:\Program Files\dotnet\sdk\5.0.301
  • 6.0.100-preview.5.21302.13 - C:\Program Files\dotnet\sdk\6.0.100-preview.5.21302.13

.NET SDK - Workload Deduplication Checkup...

.NET SDK - EnableWorkloadResolver.sentinel Checkup...

  • C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\EnableWorkloadResolver.sentinel exists.
  • C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\EnableWorkloadResolver.sentinel exists.

.NET SDK - Workloads (6.0.100-preview.5.21302.13) Checkup...

  • microsoft-android-sdk-full (Microsoft.NET.Sdk.Android.Manifest-6.0.100 : 30.0.100-preview.5.28) installed.
  • microsoft-ios-sdk-full (Microsoft.NET.Sdk.iOS.Manifest-6.0.100 : 14.5.100-preview.5.894) installed.
  • microsoft-maccatalyst-sdk-full (Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.100 : 14.5.100-preview.5.894) installed.
  • microsoft-tvos-sdk-full (Microsoft.NET.Sdk.tvOS.Manifest-6.0.100 : 14.5.100-preview.5.894) installed.
  • microsoft-macos-sdk-full (Microsoft.NET.Sdk.macOS.Manifest-6.0.100 : 11.3.100-preview.5.894) installed.

.NET SDK - Packs (6.0.100-preview.5.21302.13) Checkup...

  • Microsoft.Maui.Templates (6.0.100-preview.5.794) installed.
  • Microsoft.Android.Sdk (30.0.100-preview.5.28) installed.
  • Microsoft.Android.Sdk.BundleTool (30.0.100-preview.5.28) installed.
  • Microsoft.Android.Ref (30.0.100-preview.5.28) installed.
  • Microsoft.Android.Templates (30.0.100-preview.5.28) installed.
  • Microsoft.iOS.Sdk (14.5.100-preview.5.894) installed.
  • Microsoft.iOS.Windows.Sdk (14.5.100-preview.5.894) installed.
  • Microsoft.iOS.Ref (14.5.100-preview.5.894) installed.
  • Microsoft.iOS.Templates (14.5.100-preview.5.894) installed.
  • Microsoft.MacCatalyst.Sdk (14.5.100-preview.5.894) installed.
  • Microsoft.MacCatalyst.Ref (14.5.100-preview.5.894) installed.
  • Microsoft.MacCatalyst.Templates (14.5.100-preview.5.894) installed.
  • Microsoft.tvOS.Sdk (14.5.100-preview.5.894) installed.
  • Microsoft.tvOS.Ref (14.5.100-preview.5.894) installed.
  • Microsoft.tvOS.Templates (14.5.100-preview.5.894) installed.
  • Microsoft.macOS.Sdk (11.3.100-preview.5.894) installed.
  • Microsoft.macOS.Ref (11.3.100-preview.5.894) installed.
  • Microsoft.macOS.Templates (11.3.100-preview.5.894) installed. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  • Congratulations, everything looks great!
ivanjx commented 3 years ago

thanks for the tips. however i have reinstalled my entire visual studio installation before i was able to try out your tips. hopefully it will be helpful for anybody else facing the same issue.

Stamo-Gochev commented 3 years ago

The problem might also be caused by the environment variable MSBuildSDKsPath not being updated after the installation of the new .NET 6. You can manually configure the variable using the entry MSBuildSDKsPath and C:\Program Files\dotnet\sdk\6.0.100-rc.2.21505.57\Sdks as a value.

cr1pto commented 2 years ago

I ran into this issue today as well and doing @Stamo-Gochev's suggestion worked for me.