Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET IIS 7.5 HTTP 500.21 error

Tags:

asp.net

iis

I am having an issue setting up a local site.

The project is using ASP.NET Framework 4.0 and I have my DefaultAppPool to use 4.0 with Managed Pipeline Mode as Integrated.

This is the error I get:

HTTP Error 500.21 - Internal Server Error
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Module  IIS Web Core
Notification    ExecuteRequestHandler
Handler PageHandlerFactory-Integrated
Error Code  0x8007000d
Requested URL   http://localhost:80/default.aspx
Physical Path   C:\Snugabye\Website\default.aspx
Logon Method    Anonymous
Logon User  Anonymous

Most likely causes:
Managed handler is used; however, ASP.NET is not installed or is not installed completely.
There is a typographical error in the configuration for the handler module list.

Things you can try:
Install ASP.NET if you are using managed handler.
Ensure that the handler module's name is specified correctly. Module names are case-sensitive and use the format modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule".

Under Control Panel -> Programs -> Turn Window features on / off all I see is Microsoft .NET Framework 3.5.1 and nothing regarding 4.0 is there something I am missing?

like image 510
user1269625 Avatar asked Apr 09 '14 03:04

user1269625


3 Answers

Did you register .NET with IIS? If not run the following commands:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i 

You need to do this from an elevated command prompt (...run as admin).

like image 133
diegosasw Avatar answered Sep 19 '22 19:09

diegosasw


I am guessing that based on your .NET version that you're on Windows 7.

According to .NET 4.0 Versions and Dependencies:

(.NET 4.0) Not installed as part of the Windows operating system, but can be installed separately on Windows XP, Windows Server 2003, and later versions of Windows.

Follow this link for an installer of .NET 4.0

After installing you may have to do additional config. See this blog post.

Excerpts from the blog post in case of link loss:

After installing .NET Framework 4.0 on a machine there is a few configuration changes you need to do to IIS in order to get a ASP.NET 4.0 page running:

First set the Application pool to run in ASP.NET v4.0 “mode”.

Then you need to allow ASP.NET v4.0.x to run. This is done in the ISAPI and CGI Restrictions found on the server level.

(Go to Administrative Tools > Internet Info Services Manager > Click on the Server. Then Open ISAPI and CGI Restrictions > Find ASP.NET V4.0.XXX make sure the restriction is set to Allowed. If set to Not Allowed, double click it, and check the Allow extension path to execute. Hit OK.)

Note: Depending on order of installation you may also have to run aspnet_regiis.exe -i from the command line to "re-install" ASP.NET on IIS.

Instructions for configuring ISAPI and CGI restrictions for IIS 7.5 on various Windows flavors.

like image 23
Paul Sasik Avatar answered Sep 18 '22 19:09

Paul Sasik


I was facing the same issue. When i checked at App pool.NET framework version it was v2.0. My application was with 4.0 compatible. I ran below commands which has fixed the issue and now I am able to get my web services

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

However after running those commands the default .NET framwork also changed to v4.0

like image 25
Dipak Patil Avatar answered Sep 20 '22 19:09

Dipak Patil