IIS AspNetCore Module V2 throws failed to load coreclr
See original GitHub issueWe upgraded our asp.net core site from .NET Core 2.2 --> 3.1
The site works fine for about 18 hours and then crashes. Restarting it gives us:
HTTP Error 500.37 - ANCM Failed to Start Within Startup Time Limit
Looking in the event log, we see this:
3/4/2020 2:31:54 AM
Source: WAS
EventId: 5009
A process serving application pool 'SSO' terminated unexpectedly. The process id was '11960'. The process exit code was '0xc0000409'.
3/4/2020 2:33:51 AM
Source: WAS
EventId: 5010
A process serving application pool 'SSO' failed to respond to a ping. The process id was '13988'.
3/4/2020 2:35:52 AM
EventId: 1007
Source: IIS AspNetCore Module V2
Application '/LM/W3SVC/28/ROOT' with physical root 'D:\Sites\SSO\Site-Prod\' failed to load coreclr. Exception message:
Managed server didn't initialize after 120000 ms.
No amount of recycling / rebooting or redeploying gets the site back up and running.
Deploying the old 2.2 code works immediately.
Any idea what might be causing this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (11 by maintainers)
Top Results From Across the Web
iis 8 - .NET Core 3.0 and IIS: HTTP Error 500.30 - ANCM In ...
I changed the specification in Web.config to run out of process. Originally the specification was for InProcess as follows: <aspNetCore ...
Read more >IIS AspNetCore Module V2: Failed to start application '/LM/ ...
Common solutions to this issue: The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found. Troubleshooting steps:
Read more >HTTP Error 500.30 - ASP.NET Core app failed to start
NET Core CLR in-process, but it fails to start, thus preventing the app from running. Unfortunately, the cause of a process startup failure...
Read more >HTTP Error 500.30 - ASP.NET Core app failed to Start
Its not opening and it shows HTTP Error 500.30 - ASP. ... physical root 'C:\Program Files (x86)\UiPath\TestManager' failed to load coreclr.
Read more >ASP.NET Core IIS InProcess Hosting Issue in .NET Core 3.1
The ASP.NET Core Module attempts to start the .NET Core CLR in-process, but it fails to start. The cause of a process startup...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Putting this in the issue since I looked at the dump.
After looking at your code I think I’ve figured out the issue. You have calls to BuildServiceProvider throughout your startup code some in per request locations. That will create a new service provider universe and you’re also not disposing things.
Some examples on how to fix things:
Should be:
The real issue is in OnMessageReceived in the call to AddOpenIdConnect, you build the service provider potentially twice per request.
Should be:
I’ll work on getting a runnable sample I can upload - it might be a few days given my current workload. Just have to carve out the portions of the site that are confidential.