I am run aspnet_regiis.exe, still I am getting same error:
Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.Ser
I got the same error after upgrading the IIS server to .NET 4.5.1 (previously .NET 4.0 was installed).
In my case, running aspnet_regiis
with the parameter -iru
fixed the problem, ie.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -iru
Note: on a 64bit system you should use
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -iru
Notes:
.NET 4.0 and higher (e.g. 4.5.1) all installs into v.4.0.30319, this has changed compared to earlier versions (you will not find a v4.5 folder). To get the installed .NET framework versions, see this answer.
The cause of this error is described here, If you want to check manually, I cite the following from this article:
This issue occurs because the Applicationhost.config file for Windows Process Activation Service (WAS) has the following section defined, and this section is incompatible with the .NET Framework 4.0:
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
This section should be defined as follows (notice the preCondition
):
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule,
System.ServiceModel, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
preCondition="managedHandler,runtimeVersionv2.0" />
Note: You can find the Applicationhost.config
file in the following location: %windir%\system32\inetsrv\config
If you are running Windows 8, this method will not work. Microsoft will not let you to run this command, telling you this:
This option is not supported on this version of the operating system. Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog, the Server Manager management tool, or the dism.exe command line tool.
The reasons for this are on this link: http://support.microsoft.com/kb/2736284 .
The solution that worked for me is posted on this link, on the answer by Neha: System.ServiceModel.Activation.HttpModule error
Everywhere the problem to this solution was mentioned as re-registering aspNet by using aspnet_regiis.exe. But this did not work for me.
Though this is a valid solution (as explained beautifully here)
but it did not work with Windows 8.
For Windows 8 you need to Windows features and enable everything under ".Net Framework 3.5" and ".Net Framework 4.5 Advanced Services".
Thanks Neha
It seems like the ASP.NET 4.0 is not properly registered with IIS. Could you please try re-registering asp.net with IIS ? You could try for both 2.0 and 4.0 just to make sure it is done for all the .NET versions.
Use the following commands for both version of asp.net to register asp.net with IIS
aspnet_regiis -i
This is located in both .NET framework version folders.
C:\Windows\Microsoft.NET\Framework\v4.0.30319 and C:\Windows\Microsoft.NET\Framework\v2.0.50727
I am late, hope it will help someone ....This is a known issue with IIS 8.0
The solution is to delete the 3.x module and handler from IIS manager. You could delete them at the application or site level if you want to keep them in applicationHost.config. But I wanted to delete them from applicationHost.config. do the following steps:
In IIS manager, click the machine name node. In “Features View”, double-click “Modules”. Find “ServiceModel” and remove it. Image 1 for Solve IIS 8 Error: Could not load type ‘System.ServiceModel.Activation.HttpModule’
Go back to the machine name node’s “Features View”, double-click “Handler Mappings”. Find “svc-Integrated” and remove it. Image 2 for Solve IIS 8 Error: Could not load type ‘System.ServiceModel.Activation.HttpModule’
To resolve this issue, run the following command line:
To resolve this issue, run the following command line:
It will work definitely.