Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting HRESULT: 0x80131534 on Windows 8.1 when using dotnet #9272

Closed
bass3l opened this issue Nov 14, 2017 · 16 comments
Closed

getting HRESULT: 0x80131534 on Windows 8.1 when using dotnet #9272

bass3l opened this issue Nov 14, 2017 · 16 comments

Comments

@bass3l
Copy link

bass3l commented Nov 14, 2017

Hello,

I'm facing the following error whenever I use dotnet cli:
Failed To Initialize CoreCLR, HRESULT: 0x80131534

I know that HRESULT: 0x80131534 is TypeInitializationException

I have the following re-installed like a thousand times:

  • .NET Framework 4.7.1 DevPack and Runtimes.
  • .NET Core 2.0.2 SDK
  • .NET Core 2.0.0 Runtime

on Windows 8.1 Enterprise

Please advise

@RussKeldorph
Copy link
Contributor

I created new Win8.1 Enterprise machine, installed updates, installed .NET Core 2.0.2 SDK (including 2.0.0 Runtime), and installed 4.7.1. From command prompt: mkdir foo; cd foo; dotnet new; dotnet run. I got "Hello, World!" as expected. Is there something more to your repro?

@weshaggard should this be opened in the dotnet/cli repo instead?

@weshaggard
Copy link
Member

@bass3l can you provide a little more repro steps? Can you give us the output of dotnet --version? I sometimes see this when there is a mix-match between architectures as well so make sure you are running x86 or x64 according to your OS.

@bass3l
Copy link
Author

bass3l commented Nov 18, 2017

@weshaggard all dotnet commands gave me the same error HRESULT: 0x80131534 and I'm sure I was using the correct architecture for my OS which is x64. I'm sorry I can't reproduce the issue on my machine anymore, I wasted lots of time on it so I had to roll a fresh copy of windows and it's working fine now.

I think the problem was with some missed up files of the SDK and .net framework which weren't getting cleaned even though with re-installing them...

@bass3l bass3l closed this as completed Nov 18, 2017
@jmderuty
Copy link

jmderuty commented Feb 6, 2018

I was able to reproduce this issue on Win10 with the following configuration:

  • Self contained runtime (v2)
  • Win8 compatibility mode

When starting the executable, it displays on the console: "Failed to initialize CoreCLR, HRESULT: 0x80131534"

@jkotas jkotas reopened this Feb 7, 2018
@RussKeldorph
Copy link
Contributor

I can repro this now. I briefly looked in the debugger and I think the first error is an LCMapStringEx failure, which seems like a plausible place for a difference between Win8 and Win10, so putting in System.Globalization. @tarekgh Could you take a look?

@tarekgh
Copy link
Member

tarekgh commented Feb 9, 2018

@RussKeldorph do you have a stack or more info here?

@tarekgh
Copy link
Member

tarekgh commented Feb 9, 2018

I can repro it too. will take a closer look

@tarekgh
Copy link
Member

tarekgh commented Feb 9, 2018

@bass3l could you please go to the folder that has the dotnet.exe (usually at C:\Program Files\dotnet) and then right clicks on the file dotnet.exe, then click on the compatibility tab and tell me what settings you have there?

@bass3l
Copy link
Author

bass3l commented Feb 9, 2018

Sorry I can't, I've installed a fresh copy of windows to resolve the issue and it has been a while. Maybe @jmderuty can help

@RussKeldorph
Copy link
Contributor

If it helps, my version info:

>dotnet --info
.NET Command Line Tools (2.0.2)

Product Information:
 Version:            2.0.2
 Commit SHA-1 hash:  a04b4bf512

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

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

I can repro it by adding the following registry value:

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files\\dotnet\\dotnet.exe"="~ WIN8RTM"

Stack at first clr exception:

0:000> !clrstack
OS Thread Id: 0x5bb4 (0)
        Child SP               IP Call Site
000000a5fe57c758 00007ffee76b3fb8 [HelperMethodFrame: 000000a5fe57c758] 
000000a5fe57c850 00007ffe85ebc8be System.Globalization.TextInfo.ChangeCase(System.String, Boolean)
000000a5fe57c8f0 00007ffe85b05e75 System.Diagnostics.Tracing.EventSource.GetGuid(System.Type)
000000a5fe57c950 00007ffe85b065c0 System.Diagnostics.Tracing.EventSource..ctor(System.Diagnostics.Tracing.EventSourceSettings, System.String[])
000000a5fe57c9d0 00007ffe85c2e914 System.Buffers.ArrayPoolEventSource..cctor()
000000a5fe57cdc8 00007ffe86142d33 [GCFrame: 000000a5fe57cdc8] 
000000a5fe57d7d8 00007ffe86142d33 [HelperMethodFrame: 000000a5fe57d7d8] 
000000a5fe57d8e0 00007ffe85cf613d System.Buffers.TlsOverPerCoreLockedStacksArrayPool`1[[System.Char, System.Private.CoreLib]].Rent(Int32)
000000a5fe57d970 00007ffe85aed0e4 System.IO.PathHelper.Normalize(System.String, Boolean, Boolean)
000000a5fe57d9f0 00007ffe85ab49f2 System.IO.Path.GetFullPath(System.String)
000000a5fe57da40 00007ffe85a239bf System.AppDomain.NormalizeAppPaths(System.String)
000000a5fe57daa0 00007ffe85a238a2 System.AppDomain.Setup(System.Object)
000000a5fe57de50 00007ffe86142d33 [GCFrame: 000000a5fe57de50] 
000000a5fe57e218 00007ffe86142d33 [GCFrame: 000000a5fe57e218] 

@dotnet/dotnet-diag @nategraf @brianrob Due to possible diag and/or tracing connections.

@brianrob
Copy link
Member

brianrob commented Feb 9, 2018

@tarekgh it looks like this is failing on the call to ToUpperInvariant: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs#L350

@tarekgh
Copy link
Member

tarekgh commented Feb 9, 2018

@RussKeldorph @brianrob I know exactly what the problem is, but I want to confirm this problem occur only when setting the compatability mode on the exe (which is dotnet). this is why I was hoping @bass3l or @jmderuty can confirm.

The underlying problem is coming from Windows, I'll talk to them and will try to find if there is a reasonable workaround from the framework side.

@brianrob
Copy link
Member

brianrob commented Feb 9, 2018

Thanks @tarekgh!

@jmderuty
Copy link

jmderuty commented Feb 9, 2018

Hello,
The issue was originally reported by one of our players as a patcher issue. After investigation, we found out that (for whatever reason) he had enabled Win8 compatibility mode in the compatibility tab of the patcher executable properties window (self contained netcore2 application)

I hadn't tested with dotnet.exe prior to your request, only with a self contained helloworld application, and I confirm that I was able to reproduce with the Win8 compatibility mode. Going to try with dotnet.exe in a few moment.

@tarekgh
Copy link
Member

tarekgh commented Feb 9, 2018

thanks @jmderuty for confirming

@tarekgh
Copy link
Member

tarekgh commented Feb 12, 2018

Closing this issue per the discussion here. net core is not supported with Windows compatibility mode. users should not try to set the compatibility mode on dotnet.exe.

@tarekgh tarekgh closed this as completed Feb 12, 2018
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants