Sunday, December 15, 2013

.NET Framework 4 application issues on fresh Windows 2008 R2 installation

A bit of frustration with Windows Server 2008 R2 and the .NET Framework 4.0.  Just because you use the Add-WindowsFeature Application-Server option to add the .NET Framework, the 4.0 Framework may not be properly registered with IIS.  This seems to be true when you install the 4.0 Framework first and then later add Web-Server and Application-Server options to Windows later.

I installed the prerequisites, then installed my 4.0 Framework application and got this error:

HTTP Error 500.21 - Internal Server Error

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

This implies that the ASP.NET managed handler is incorrect, but in reality the 4.0 Framework is not properly registered.

Open up a command prompt as an administrator, then change to this folder:
C:\Windows\Microsoft.NET\Framework\v4.0.30319 

Run this command:
aspnet_regiis.exe -iru 

  There are a couple of different installation/registration options for aspnet_regiis.exe, but the -iru option is the safest since it only registers the 4.0 Framework and does not change/update any existing applications or web sites.  That is helpful if you have web applications that are still using the 2.0 Framework.

0 Comments:

Post a Comment

<< Home