When trying to uninstall a listed .net sdk install I get "The system cannot find the file specified."
- Dominant language
- C#
- Stars
- 774
- Forks
- 72
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 2
Description
Getting a cannot find the file specified error on Windows 10 Version 22H2 OS Build 19045.2130 x64
Trying to uninstall from control panel also has an error, but as shown in the explorer screenshot they are all there, and your utility also detects the install.
```
Uninstalling: Microsoft .NET SDK 6.0.100 (x64).
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
```
Here is the full output of `dotnet-core-uninstall list` output showing the sdk is available to uninstall:
dotnet-core-uninstall list
```
C:\WINDOWS\system32>dotnet-core-uninstall list
This tool cannot uninstall versions of the runtime or SDK that are
- SDKs installed using Visual Studio 2019 Update 3 or later.
- SDKs and runtimes installed via zip/scripts.
- Runtimes installed with SDKs (these should be removed by removing that SDK).
The versions that can be uninstalled with this tool are:
.NET Core SDKs:
6.0.400 x64 [Used by Visual Studio. Specify individually or use --force to remove]
6.0.100 x64
5.0.103 x64
.NET Core Runtimes:
ASP.NET Core Runtimes:
.NET Core Runtime & Hosting Bundles:
```
Here is the full output of `dotnet-core-uninstall remove --sdk 6.0.100 --x64 -v diag`:
dotnet-core-uninstall remove --sdk 6.0.100 --x64 -v diag
```
C:\WINDOWS\system32>dotnet-core-uninstall remove --sdk 6.0.100 --x64 -v diag
The following items will be removed:
Microsoft .NET SDK 6.0.100 (x64)
To avoid breaking Visual Studio or other problems, read https://aka.ms/dotnet-core-uninstall-docs.
Do you want to continue? [y/n] y
Uninstalling: Microsoft .NET SDK 6.0.100 (x64).
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Microsoft.DotNet.Tools.Uninstall.Shared.Commands.UninstallCommandExec.DoIt(IEnumerable`1 bundles)
at Microsoft.DotNet.Tools.Uninstall.Shared.Commands.UninstallCommandExec.Execute(IBundleCollector bundleCollector)
at Microsoft.DotNet.Tools.Uninstall.Shared.Configs.CommandLineConfigs.<>c__DisplayClass40_0.<.cctor>b__6()
at Microsoft.DotNet.Tools.Uninstall.Shared.Exceptions.ExceptionHandler.<>c__DisplayClass0_0.b__0()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__22_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<b__0>d.MoveNext()
```
Screenshot of my dotnet sdk folder

Screenshot of program and features, and uninstall error message


Contributor guide
Assessment
This issue has not been assessed yet.