How to fix: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
Asked Answered
B

19

545

I am configuring an MVC 3 project to work on a local install of IIS and came across the following 500 error:

Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list.

It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the "Add Feature" dialog. To fix this, I simply ran the following command at the command prompt

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

If I had been on a 32 bit system, it would have looked like the following:

%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i

My question is, is there a way to install IIS on a windows 7 box to use .NET 4.0 (MVC 3) without taking this extra step?

Barrybarrymore answered 27/7, 2011 at 14:59 Comment(2)
The question actually solved my problem. I would have answered the question as an answer if I could. :)Sig
Yeah, the question's description solved my problem too. Thanks:-)Shawannashawl
B
953

It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the "Add Feature" dialog. To fix this, I simply ran the following command at the command prompt

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

If I had been on a 32 bit system, it would have looked like the following:

%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i

Remeber to run the command prompt as administrator (CTRL+SHIFT+ENTER)

Barrybarrymore answered 10/5, 2012 at 19:51 Comment(6)
You might have "Aspnet_regiis.exe is not recognized as an internal or external command, operable program or batch file." error. In this case you the executable not from the .NET 4.0 folder, but from the 2.0 one (see my answer below)Home
In some sites, I read that we needed to run aspnet_regiis.exe but none explained that the parameter is required, otherwise nothing happens.Cassimere
great simple answer. I knew it was a bad install, didn't know how to correct it.Mullet
Note that if you're using Windows Server 2012, you'll need to this through Manage > Add Roles and Features > Features. In my case IIS8 needed to have ASP.NET 4.5 installed/activated.Absorbance
remember to run as administratorChen
Works on Windows 7 for me. Looks like once you enable the asp.net features on IIS they dont work immediately unless this command is run..Rachitis
H
17

The accepted answer is correct, however sometimes you would get the "Aspnet_regiis.exe is not recognized as an internal or external command, operable program or batch file." error message.

To resolve it try the following:

  1. Make sure that your .NET 4.0 installation is not corrupted (run the installer and 'Repair' it). There's also a chance it is not installed on your machine at all.

  2. If you're sure you don't have .NET 4.0 installed and want to run it as .NET 2.0, try this:

If you see the message "Aspnet_regiis.exe is not recognized as an internal or external command, operable program or batch file.", switch to the C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet_regiis.exe -i at the command prompt.

Home answered 13/6, 2012 at 14:3 Comment(1)
Aspnet_regiis.exe -i fixed my problem on Win Server 2008 IIS7.Abbeyabbi
R
11

Error: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

I found the articles to fix this issue by simply run the following commands at the command prompt:

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

If the system is 32 bit, it would have looked like this:

%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i

But, when I tried to execute these commands using a command prompt, I got the following error/warning message:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i Microsoft (R) ASP.NET RegIIS version 4.0.30319.33440 Administration utility to install and uninstall ASP.NET on the local machine. Copyright (C) Microsoft Corporation. All rights reserved. Start installing ASP.NET (4.0.30319.33440). This option is not supported on this version of the operating system. Administr ators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Win dows Features On/Off" dialog, the Server Manager management tool, or the dism.exe command line tool. For more details please see http://go.microsoft.com/fwlin k/?LinkID=216771. Finished installing ASP.NET (4.0.30319.33440).**

To fix this on a Windows 8.1, I would suggest to do the following thing.

Solution:

Goto: Turn Windows features on or off -> Internet Information Services -> World Wide Web Services -> Application Development Features -> Enable ASP.NET 4.5

This should resolve the issue.

Rubino answered 2/6, 2015 at 10:51 Comment(2)
I had the same problem. Thanks! For me I had to enable "ASP.NET 4.6".Gotama
I had the same problem and I had to enable "ASP.NET 4.7".Corium
L
9

To solve the issue try to repair the .net framework 4 and then run the command

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
Lukewarm answered 4/8, 2012 at 5:54 Comment(0)
C
4

I would also check the obvious first: that the application pool is set to the correct framework and that your IIS application actually points to the folder where you put your files

Cloth answered 2/3, 2014 at 11:36 Comment(1)
This was the problem for me. Apparently somehow I unset this or it got set to "No Managed Code." Switching it back to v4.0 got my site to load.Lermontov
S
3

If you want to deploy an MVC application without installing MVC, you can deploy the MVC DLL's with your application. This gets around installing MVC 3. You can use features in some .Net 4.0 namespaces without installing .Net using a similar approach.

Soubriquet answered 12/3, 2012 at 6:8 Comment(1)
registering asp.net with iis has nothing to do with mvc being present or not , yes you can include the required dlls in your bin folder , but if iis is not recognizing asp files there is not much that the dlls can doOtology
R
3

I added the ISAPI/CGI paths for .Net 4. Which didn't fix the issue. So I then ran a repair on the .Net V4 (Client and Extended) installation. Which asked for a reboot. This fixed it for me.

Republicanize answered 10/9, 2012 at 6:37 Comment(0)
H
2

To fix this on a Windows 8.1 Professional machine do the following.

  1. Install the Web Platform Installer. http://www.microsoft.com/web/downloads/platform.aspx

  2. In Web Platform Installer install ASP.NET 4.5 (This feature has one dependency).

If you simply try the aforementioned cmd prompt command from the most popular answer you will get the following error/warning message:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i Microsoft (R) ASP.NET RegIIS version 4.0.30319.33440 Administration utility to install and uninstall ASP.NET on the local machine. Copyright (C) Microsoft Corporation. All rights reserved. Start installing ASP.NET (4.0.30319.33440). This option is not supported on this version of the operating system. Administr ators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Win dows Features On/Off" dialog, the Server Manager management tool, or the dism.e xe command line tool. For more details please see http://go.microsoft.com/fwlin k/?LinkID=216771. Finished installing ASP.NET (4.0.30319.33440).

Humpy answered 30/4, 2014 at 8:54 Comment(0)
S
2

I have tried to do aspnet_regiis in command prompt but I got answer that I don't have admin rights. Then, after some more googling and looking for a solution I tried to right click cmd and run it as an admin. Confirmed yes when dialog appeared, ran aspnet_iis again ant worked like a charm. In short: 1. check .NET framework in app_pool 2. run cmd as an admin 3. run aspnet_regiis -i

Scevor answered 4/8, 2014 at 13:19 Comment(0)
L
2

I had the same problem and my solution was:

Go to "Turn Windows features on or off" > Internet Information Services > World Wide Web Services > Application Development Features >Enable ASP.NET 4.5

Laliberte answered 21/8, 2014 at 17:36 Comment(2)
This works like a charm, but is there any reason why I wouldn't want to do this on a production server, given that it's an "Application Development Feature"?Taeniacide
I don't know enough about that feature to comment on using it in a production environment. However I did find this link that might be helpful technet.microsoft.com/en-us/library/hh831475.aspx. It also contains a command that you can use to install IIS and ASP.NET modules via command prompt, which might be more suitable to your production needs.Laliberte
A
1

I had a similar issue with Windows server 2012, installing the feature "Application Server" in the server manager fixed the issue.

Antislavery answered 26/11, 2013 at 18:3 Comment(0)
C
1

-Using application initalization feature -requesting wrong pages (.asp) because of config inheritance

500.21 will occur on the first user connection only. Subsequent connections work.

Resolved by correcting the applicationInitialization url collection on the .NET website.

Countermarch answered 15/1, 2014 at 8:9 Comment(0)
P
1
  1. run cmd

  2. drag and drop Aspnet_regiis.exe into the command prompt from:

    C:\Windows\Microsoft.NET\Framework64\v2.0.50727\
    
  3. type -i (for example Aspnet_regiis.exe -i)

  4. hit enter

  5. wait until the process completes

Good luck!

Phenoxide answered 29/6, 2019 at 3:40 Comment(0)
R
0

I had this problem and found that removing the following folder helped, even with the non-Express edition.Express:

C:\Users\<user>\Documents\IISExpress

Rodl answered 15/2, 2013 at 12:14 Comment(0)
P
0

None of these worked for me. So as I compared various app pools with one that worked vs one that didn't, I had to go into Advanced Settings for the App Pool, and set

Enable 32-Bit Applications = true

Then it worked fine!

Pedaias answered 29/8, 2013 at 15:26 Comment(0)
T
0

I had the same problem, in my case handler was in two places:

<system.web>
...
<httpHandlers>
 <add verb="*" path="*.ashx" type="ApplicArt.Extranet2.Controller.FrontController, ApplicArt.Extranet2.Web.UI" />
  </httpHandlers>
</system.web>

<system.webServer>
<handlers>
   ...
  <add name="FrontController" verb="*" path="*.ashx" type="ApplicArt.Extranet2.Controller.FrontController, ApplicArt.Extranet2.Web.UI"/>
</handlers>
</system.webServer>

And when I removed my handler from [system.webServer] my problem disappeared.

Toms answered 16/6, 2014 at 20:7 Comment(0)
F
0

in some scenario this error occurs because the Microsoft .NET Framework 4.0 configuration for ASP .NET has been damaged, which can occur if Microsoft Visual Studio 2012 was installed before Visual Studio 2010 or Microsoft SQL Server 2008.

After trying different things i reached the conclusion, repair you .Net installation by running following command. For more information follow the link.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SetupCache\v4.5.51209\setup.exe /repair /x86 /x64 /ia64 /norestart

https://msdn.microsoft.com/en-us/library/hh168535(v=nav.80).aspx

Ferren answered 15/5, 2015 at 17:12 Comment(0)
V
0

To solve the issue try to repair the .net framework 4 and then run the command

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

enter image description here

Voluntary answered 14/5, 2017 at 2:16 Comment(1)
Have you read all the posted answers before posting your own?Exarate
E
0

I was having this issue on one of my webservers when trying to switch an apppool from classic to integrated. It worked fine on two of my other webservers, not just this one. It's Server 2012, so you can't do the aspnet_regiis and there was no setupcache folder to try that repair. Everything was set correctly under features.

After going through %windir%\system32\inetsrv\config\applicationHost.config I found one critical missing bit. Under my non-working one was missing the following two lines:

        <add name="ManagedEngineV4.0_32bit" image="C:\Windows\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
        <add name="ManagedEngineV4.0_64bit" image="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />

Once I added them, everything worked great.

Enamor answered 16/6, 2017 at 16:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.