Monday 7 November 2011

Could not load type 'System.ServiceModel.Activation.HttpModule'


Have you started working on a .NET 4.0 project and received the following error?
Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

If you have, you probably have installed .Net framework 4.0 on IIS and then enable either a .Net 3.0 or 3.5 WCF feature.  To fix you need to reconfigure ASP.NET by using the following command depending on the version of ASP.NET you have installed.

IIS 32 bit

%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis /iru

IIS 64 bit

%SYSTEMROOT%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis /iru

1 comment:

Tania R S A said...

Great, worked perfectly for me! Thanks!