VS2022 debugger crash with error Failed to read environment variable [DOTNET_STARTUP_HOOKS], HRESULT: 0x800700CB

Guillaume Bruyneel 15 Reputation points
2023-05-25T14:25:59.41+00:00

My config is as follow:

Microsoft Visual Studio Community 2022
Version 17.6.1
VisualStudio.17.Release/17.6.1+33717.318
Microsoft .NET Framework
Version 4.8.09037

Installed Version: Community

Visual C++ 2022   00482-90000-00000-AA359
Microsoft Visual C++ 2022

ASP.NET and Web Tools   17.6.326.62524
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.6.326.62524
Azure App Service Tools v3.0.0

C# Tools   4.6.0-3.23259.8+c3cc1d0ceeab1a65da0217e403851a1e8a30086a
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Extensibility Message Bus   1.4.21 (main@8f226a8)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio   17.6.41 (790a401)
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.5.50201.1 Commit Hash:0a76e2b03608f2fdee0e7d2e38e83d7721149b5f
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   6.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core)   17.6.0.2326105+37f2727000f6a964584cafb86e69cf0b39baecb7
Provides languages services for ASP.NET Core Razor.

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools   17.0.20329.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.6.0-3.23259.8+c3cc1d0ceeab1a65da0217e403851a1e8a30086a
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.6.0-beta.23174.5+0207bea1afae48d9351ac26fb51afc8260de0a97
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

VSPackage Extension   1.0
VSPackage Visual Studio Extension Detailed Info

Xamarin   17.6.0.251 (d17-6@318364c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.6.6.0 (remotes/origin/d17-6@cb430751d1)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK   13.2.0.6 (d17-5/a200af1)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: 6dd9def
    Java.Interop: xamarin/java.interop/d17-5@149d70fe
    SQLite: xamarin/sqlite/3.40.1@68c69d8
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@9f02d77

I Have created a WPF App .NET Framework. Every time i try to debug, vs is crashing and I have all these event in the event log:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: exception code c0000005, exception address 00007FFCE0757A20
Stack:

Faulting application name: devenv.exe, version: 17.6.33717.318, time stamp: 0x6465629a
Faulting module name: ucrtbased.dll, version: 10.0.22000.832, time stamp: 0xa4cc7ab0
Exception code: 0xc0000005
Fault offset: 0x0000000000107a20
Faulting process id: 0x42b4
Faulting application start time: 0x01d98f116f859098
Faulting application path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe
Faulting module path: C:\Windows\SYSTEM32\ucrtbased.dll
Report Id: 0d980f37-ae03-43fa-b061-02952ed57f63
Faulting package full name:
Faulting package-relative application ID:

Description: A .NET application failed.
Application: ServiceHub.Host.dotnet.x64.exe
Path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.Dotnet.x64\ServiceHub.Host.dotnet.x64.exe
Message: Failed to read environment variable [DOTNET_STARTUP_HOOKS], HRESULT: 0x800700CB

Description: A .NET application failed.
Application: ServiceHub.DataWarehouseHost.exe
Path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.Dotnet.x64\ServiceHub.DataWarehouseHost.exe
Message: Failed to read environment variable [DOTNET_STARTUP_HOOKS], HRESULT: 0x800700CB

Description: A .NET application failed.
Application: ServiceHub.RoslynCodeAnalysisService.exe
Path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.Dotnet.x64\ServiceHub.RoslynCodeAnalysisService.exe
Message: Failed to read environment variable [DOTNET_STARTUP_HOOKS], HRESULT: 0x800700CB

and :

Description: A .NET application failed.
Application: ServiceHub.IndexingService.exe
Path: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\ServiceHub\Hosts\ServiceHub.Host.Dotnet.x64\ServiceHub.IndexingService.exe
Message: Failed to read environment variable [DOTNET_STARTUP_HOOKS], HRESULT: 0x800700CB

I Run Windows 10 Pro 10.0.19045 Build 19045 with Us-English set for windows and VS2022.

Impossible to debug.

Thanks for your answer...

best Regards.

Developer technologies | Visual Studio | Debugging
Developer technologies | Visual Studio | Other
{count} votes

8 answers

Sort by: Most helpful
  1. Dan Moseley 6 Reputation points Microsoft Employee
    2023-06-16T19:27:59.0533333+00:00
    1 person found this answer helpful.
    0 comments No comments

  2. Chrysostomos Kolovos 0 Reputation points
    2023-05-31T13:36:13.3266667+00:00

    I have the same problem after upgrading to 17.6.x

    0 comments No comments

  3. Sheraz Hussain 0 Reputation points
    2023-06-06T14:36:23.84+00:00

    Did anyone able to find the resolution of this issue? I am unable to open Visual studio

    0 comments No comments

  4. Sayed Mahmoud 0 Reputation points
    2023-06-06T21:53:17.73+00:00

    Same problem here...
    Visual Studio 2022 V17.6.2

    0 comments No comments

  5. Bryant Byrd 0 Reputation points
    2023-06-09T12:18:21.37+00:00

    I received the "Failed to read environment variable [DOTNET_STARTUP_HOOKS]" message when I tried to create a new project after upgrading Visual Studio to 17.6.2.

    I ran a Repair of Visual Studio form the VS Installer and it's fixed now.

    The Repair required a restart of my computer while the upgrade didn't. It's possible that restarting after the upgrade might be required, even though the installer doesn't request it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.