Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Installer Missing option value: InstallPath - Visual Studio 2019

I have the visual studio 2019 enterprise edition (VS 2019 16.1.4) installed with valid license (Visual Studio Subscription) and it was working good.

All of sudden, when I try to open a project or any file that is part of the project, I am getting the following error.

enter image description here

So I tried to uninstall using the Visual Studio Uninstaller, when I selected uninstaller, it got updated automatically and when I open uninstaller now, it says

enter image description here

When I click Ok, it says You haven't installed anything yet and it only has the option to install VS 2019 16.2.0.

Even if I try to install VS 2019 16.2.0 , I see the error

"Visual Studio cannot be installed to a nonempty directory 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise'."

Kindly help me resolve the error.

Update

=====================
12-08-2019 06:31:09 PM
Recoverable
System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: Element not found. (Exception from HRESULT: 0x80070490)
   at Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration.GetInstanceForCurrentProcess()
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPrereleaseAsync>d__44.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPreviewSDKInUseAsync>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<CheckCompatibilityAsync>d__47.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<<InitializeAsync>b__40_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__DisplayClass32_1.<<Fork>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Runtime.InteropServices.COMException (0x80070490): Element not found. (Exception from HRESULT: 0x80070490)
   at Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration.GetInstanceForCurrentProcess()
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPrereleaseAsync>d__44.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<IsPreviewSDKInUseAsync>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<CheckCompatibilityAsync>d__47.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.VS.DotNetCoreProjectCompatibilityDetector.<<InitializeAsync>b__40_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__DisplayClass32_1.<<Fork>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---

===================

I started to face this issue very frequently(twice a week) and the only solution was to reinstall every time. So downgraded VS to 2017 for now.

like image 953
Gopi Avatar asked Jul 26 '19 08:07

Gopi


People also ask

How do I install Visual Studio installer?

In the Windows Start menu, you can search for "installer", and then select Visual Studio Installer from the results. If you have Visual Studio open, select Tools > Get Tools and Features..., which opens the Visual Studio Installer.

How do I completely reinstall Visual Studio?

From the Start menu in Windows, search for "installer", and then select Visual Studio Installer from the results. You might be prompted to update the Visual Studio Installer before continuing. If so, follow the prompts. In the Visual Studio Installer, look for the installation of Visual Studio that you want to repair.

Can you add workloads to Visual Studio 2019 after installation?

Change workloads or individual componentsIn the Visual Studio Installer, choose the Workloads tab, and then select or deselect the workloads that you want. Choose whether you want to accept the default Install while downloading option or the Download all, then install option.


1 Answers

To uninstall the VS 2019, please follow the steps as below to clean up the installed VS and re-install it:

• See if you have this file on your machine: "%programfiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe"

• If so, please launch it from an admin command prompt with a -full param: InstallCleanup.exe -full

• If not, please manually delete the "%programfiles(x86)%\Microsoft Visual Studio\Installer” folder

• Relaunch the newly downloaded vs_enterprise.exe (or vs_professional.exe or vs_community.exe…)

• Allow the first step to install the installer

• Once the installer comes up and you can see workload choices (.net desktop and the like), close it

• Go launch the same InstallCleanup.exe to clean up old build of VS

• Then re-run the VS installer to install

Please then let us know if this works for you.

like image 85
Sara Liu - MSFT Avatar answered Nov 15 '22 06:11

Sara Liu - MSFT