runtime: Running a simple ASP.NET core application causing Coreclr.dll throwing exception

I am testing .NET 6 on my dev environment. The simple hello world console app works well, but simple ASP.NET Core Web application consistently throwing following exception when running on Windows Server 2016. I had the same app running well on different EC2 with similar configuration. I need some help to understand what’s causing the issue before I prepare/deploy application on production.

Thanks.

From Windows Event Logs:

Faulting application name: WebTestApp6.exe, version: 1.0.0.0, time stamp: 0x62571213 Faulting module name: coreclr.dll, version: 6.0.522.21309, time stamp: 0x625708f4 Exception code: 0xc0000005 Fault offset: 0x0000000000082288 Faulting process id: 0x44c Faulting application start time: 0x01d87055e87be788 Faulting application path: D:\TestWeb2\WebTestApp6.exe Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.5\coreclr.dll Report Id: a368f0c5-d5c3-446f-b79a-b92b1fa6df3f Faulting package full name: Faulting package-relative application ID:

Stack trace:

D:\TestWeb2>WebTestApp6.exe
Fatal error. Internal CLR error. (0x80131506)
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Span`1<System.Object> ByRef, System.Signature, Boolean, Boolean)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1<System.Object> ByRef, System.Reflection.RuntimeModule, Int32, System.RuntimeType, Boolean, ListBuilder`1<System.Object>)
   at System.Reflection.CustomAttribute.GetCustomAttributes(System.Reflection.RuntimeModule, Int32, Int32, System.RuntimeType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(System.RuntimeType, System.RuntimeType, Boolean)
   at System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, Boolean)
   at System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, Boolean)
   at System.Diagnostics.Tracing.EventSource.GetCustomAttributeHelper(System.Reflection.MemberInfo, System.Type, System.Diagnostics.Tracing.EventManifestOptions)
   at System.Diagnostics.Tracing.EventSource.GetGuid(System.Type)
   at System.Diagnostics.Tracing.EventSource..ctor(System.Diagnostics.Tracing.EventSourceSettings, System.String[])
   at System.Net.NetEventSource..cctor()
   at System.Net.Quic.Implementations.MsQuic.Internal.MsQuicApi..cctor()
   at System.Net.Quic.Implementations.MsQuic.MsQuicImplementationProvider.get_IsSupported()
   at Microsoft.AspNetCore.Hosting.WebHostBuilderQuicExtensions.UseQuic(Microsoft.AspNetCore.Hosting.IWebHostBuilder)
   at Microsoft.AspNetCore.Hosting.WebHostBuilderKestrelExtensions.UseKestrel(Microsoft.AspNetCore.Hosting.IWebHostBuilder)
   at Microsoft.AspNetCore.WebHost.ConfigureWebDefaults(Microsoft.AspNetCore.Hosting.IWebHostBuilder)
   at Microsoft.Extensions.Hosting.GenericHostBuilderExtensions+<>c__DisplayClass0_0.<ConfigureWebHostDefaults>b__0(Microsoft.AspNetCore.Hosting.IWebHostBuilder)
   at Microsoft.Extensions.Hosting.GenericHostWebHostBuilderExtensions.ConfigureWebHost(Microsoft.Extensions.Hosting.IHostBuilder, System.Action`1<Microsoft.AspNetCore.Hosting.IWebHostBuilder>, System.Action`1<Microsoft.Extensions.Hosting.WebHostBuilderOptions>)
   at Microsoft.AspNetCore.Builder.WebApplicationBuilder..ctor(Microsoft.AspNetCore.Builder.WebApplicationOptions, System.Action`1<Microsoft.Extensions.Hosting.IHostBuilder>)
   at Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(System.String[])
   at Program.<Main>$(System.String[])

EC2 instance and OS version:

OS Name: Microsoft Windows Server 2016 Datacenter OS Version: 10.0.14393 N/A Build 14393 OS Manufacturer: Microsoft Corporation OS Configuration: Member Server OS Build Type: Multiprocessor Free Registered Owner: EC2 Registered Organization: Amazon.com Product ID: 00376-40000-00000-AA849 Original Install Date: 4/12/2019, 10:46:23 AM System Boot Time: 5/24/2022, 4:38:08 PM System Manufacturer: Xen System Model: HVM domU System Type: x64-based PC Processor(s): 1 Processor(s) Installed. [01]: Intel64 Family 6 Model 79 Stepping 1 GenuineIntel ~2300 Mhz BIOS Version: Xen 4.2.amazon, 8/24/2006

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 20 (6 by maintainers)

Most upvoted comments

@mpiracha if you are using certain security agents (e.g. Contrast .NET) they may be interfering. I was having an extremely similar issue to you and it turns out our Contrast .NET agent was the version prior to adding .NET 6 support. Upgrading the agent resolved this mysterious crash.

If you aren’t, I hope whoever else comes across this post will find it useful.