HTTP 500 Internal Server Error – While deploying a website created in ASP.Net and .Net framework 4.0 in IIS 7.5.

 

I created a website in ASP.Net and published it to a location in the hard drive within the default projects folder of VS2010 (C:\Users\\Documents\Visual Studio 2010\Projects\\PrecompiledWeb).

This was a simple website project, nothing fancy, that looked like this:

clip_image001

I created an Application in IIS 7.5 under local host (Root -> Sites -> Default Website) and provided the physical path of the website to the location of my precompiled bit. By default the AppPool used is the DefaultAppPool that by default runs on the AppPoolIdentity. But when I try to access the site I got the following:

clip_image003

For me this error kept cropping up and the reason was that the account on which the app pool was running did not have access to the physical location of the website files. You can check the account by going to Application pool node -> Select the app pool -> click Advanced settings on the left menu and scroll down. Ensure that you provide read access to the physical location. Once you do the error goes away.

Error: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=#.0.0.0, Culture=neutral, PublicKeyToken=####’.

Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.

As per MSDN blogs this error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.

I did install v3.0 of WCF Http Activation module after installing IIS and .Net Framework 4.0

To resolve this problem, I used the ASP.NET IIS Registration Tool (aspnet_regiis.exe,) to register the correct version of ASP.NET by using the –iru parameters as follows:

aspnet_regiis.exe -iru

IIS 7 Error when deploying ASP.Net Web Service

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

 

This error showed up when I tried to deploy an ASP.Net Web Service to IIS 7. I tried multiple thongs, including: adding Script Handlers, changing ports and what not.

But thanks to the post here, I just ran the following command and I was able to access the web service.

C:\Windows\Microsoft.NET\Framework\(version)>aspnet_regiis.exe –i

 

This command invokes the ASP.Net IIS Registration tool. Detailed here.

Register ASP.Net 4.0 handler mappings in IIS

Register ASP.Net 4.0 handler mappings in IIS:
1. Go to the .Net command prompt.
2. aspnet_regiis –i
Install the current version of ASP.NET and updates IIS  configuration at the root level to use this version of ASP.Net.
3. aspnet_regiis –r
Install this version of ASP.NET and update scriptmaps at the IIS metabase root and for all scriptmaps below the root. Existing scriptmaps are upgraded to this version regardless of the original versions.