dotnet core console app exits with error code -2147450743 (0x80008089)

1

I tried to debug a simple Visual Studio 2017(v15.7.4) generated dotnet core console app that prints one line("Hello World"), and it gets exited with error code -2147450743 (0x80008089) Below is the whole message i got.

'dotnet.exe' (CoreCLR: DefaultDomain): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.1\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The program '[12828] dotnet.exe' has exited with code -2147450743 (0x80008089).

And in terminal i see the message Failed to initialize CoreCLR, HRESULT: 0x80070057

But when i tried dotnet run command within cmd terminal, it runs correctly, and print "Hello World".

I have searched for the code, and got that error code 0x80008089 is for CoreClrInitFailure in dotnet/core-setup git repository

Below is my environment.

.NET Core SDK(global.json):
 Version:   2.1.301
 Commit:    59524873d6

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.301\

Host (useful for support):
  Version: 2.1.1
  Commit:  6985b9f684

.NET Core SDKs installed:
  2.1.201 [C:\Program Files\dotnet\sdk]
  2.1.301 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

And below is .csproj file

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

</Project>

As @Eric Erhardt said, with COREHOST_TRACE environment variable set to 1, tried both with dotnet cli which works well, and visual studio which does not. And both generate exact same stderr, except for 2 line. Below is the result from diff command.

$ diff stderr-dotnetcli.txt stderr-vs.txt
3c3
< dotnet
---
> C:\Program Files\dotnet\dotnet.exe
52c52
< dotnet
---
> C:\Program Files\dotnet\dotnet.exe
1453c1453
< HostRID is win10-x64
---
> HostRID is win8-x64
3109,3116c3109
< Launch host: C:\Program Files\dotnet\dotnet.exe, app: C:\Users\user\source\repos\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp2.1\ConsoleApp1.dll, argc: 0, args:
< --- Begin breadcrumb write
< Number of breadcrumb files to write is 4
< Breadcrumb thread write callback...
< Breadcrumbs will be written using a background thread
< Hello World!
< Waiting for breadcrumb thread to exit...
< --- End breadcrumb write 1
\ No newline at end of file
---
> Failed to initialize CoreCLR, HRESULT: 0x80070057
\ No newline at end of file
visual-studio
.net-core
asked on Stack Overflow Jul 7, 2018 by ringord • edited Jul 8, 2018 by ringord

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0