Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.ServiceModel.Activation.HttpModule error

Tags:

iis-7

.net-4.0

what is the cause of this error on below line?

<system.web>
    <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="fa-IR" uiCulture="fa-IR" />
    <compilation targetFramework="4.0" debug="true">
      <assemblies> <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089" />
like image 253
Negar Avatar asked Dec 07 '10 08:12

Negar


3 Answers

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

like image 99
Neha Avatar answered Jan 08 '23 03:01

Neha


This happens when you install .Net 4 before enabling IIS, or if you register WCF after registering .Net 4. In either case, your App Pools will be running .Net 2.0 (which is the CLR version required for .Net 3 if you have registered WCF, which installs ASP.Net 3.5, or the default if you have installed IIS after .Net 4)).

There are many references to this on the web, e.g. the MSDN blogs: http://blogs.msdn.com/b/webtopics/archive/2010/04/28/system-typeloadexception-for-system-servicemodel-activation-httpmodule-in-asp-net-4.aspx

The fix is to re-register ASP.Net 4 from the correct (32 or 64 bit) Framework folder (Framework64 on a 64bit server), using the aspnet_regiis.exe tool, e.g.

aspnet_regiis.exe -iru

like image 20
Ed209 Avatar answered Jan 08 '23 03:01

Ed209


For Windows 8 you need to Windows features and enable everything under .Net Framework 3.5 and .Net Framework 4.5 Advanced Services -> Enable Everything

like image 39
Innovation Wang Avatar answered Jan 08 '23 03:01

Innovation Wang