Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

First request to IIS site always produces 500.21 error

I believe this is the reason the 'Application Initialization' module does not work, as it appears the server does not bother to spin anything up until the first request, causing it to fail.

The error produced on every first request is:

HTTP Error 500.21 - Internal Server Error

The specified handler mapping is incorrect.

Detailed Error Information

Module ManagedPipelineHandler

Notification ExecuteRequestHandler

Handler ExtensionlessUrlHandler-Integrated-4.0

Error Code 0x00000000

I have tried the .NET repair instructions here: https://msdn.microsoft.com/en-us/library/hh168535(v=nav.90).aspx

and I've tried uninstalling/reinstalling .NET, but it seems to behave like this no matter what.

The primary reason this is annoying is the website and anything that needs to be started with it will only be started after the 2nd request.

Edit: It might be worth noting that in my "Turn Windows features on or off" menu, I only have an option to enable "ASP.NET" as oppose to "ASP.NET 4.5" as many other posts have suggested would be there. Evidently reinstalling .NET did not make this appear.

like image 590
sosil Avatar asked Oct 17 '22 20:10

sosil


1 Answers

I recently ran into this same issue after changing an application pool from Classic to Integrated Managed Pipeline Mode. I eventually found that this was occurring because the skipManagedModules attribute was set to true in the applicationInitialization element in the web.config file. After removing that attribute, things started working properly.

like image 119
user3739346 Avatar answered Oct 20 '22 16:10

user3739346