6

Whenever I load a solution in Visual Studio with a specific project set as the startup project, I get a VSHost32.exe crash. If I keep on going and launch the application, I get a COMException:

{"Invalid value for registry (Exception from HRESULT: 0x80040153 (REGDB_E_INVALIDVALUE))"}

With a stacktrace:

at System.Runtime.InteropServices.RuntimeEnvironment.GetDeveloperPath()
at System.AppDomain.SetupFusionStore(AppDomainSetup info)
at System.AppDomain.SetupDomain(Boolean allowRedirects, String path, String configFile)
CJBS
  • 15,147
  • 6
  • 86
  • 135
jcelgin
  • 1,164
  • 11
  • 21

2 Answers2

10

This can occur when a project's config file has developmentMode set, but the machine doesn't have a devPath set.

<runtime>
    <developmentMode developerInstallation="true"/>
</runtime>

Removing that will fix it up.

jcelgin
  • 1,164
  • 11
  • 21
  • 2
    You can also set DEVPATH in your environment, if you don't want to, or can't, change the exe's config file. – Droj Aug 20 '13 at 16:03
  • This may also be in the machine.config file, for example C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config. I've occasionally set it there and then forgotten. – cheerless bog Oct 19 '19 at 19:55
1

Navigate to C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config and remove the below setting from your machine config

<developmentModedeveloperinstallation=”true”/>