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

IisServiceSvc

Iis Problem Overview


I'm running my Web Project in IIS.

It is a 4.0 Framework APP.

I have a Service.svc and I get this error when I run my Application.

> "Could not load type 'System.ServiceModel.Activation.HttpModule' from > assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, > PublicKeyToken=b77a5c561934e089'"

I tried this --> aspnet_regiis.exe -iru which I found in a lot of forums and it didn't solve my problem.

Does anyone know another method ?

Iis Solutions


Solution 1 - Iis

Try with

c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru

When multiple versions of the .NET Framework are executing side-by-side on a single computer, the ASP.NET ISAPI version mapped to an ASP.NET application determines which version of the common language runtime (CLR) is used for the application.

Above command will Installs the version of ASP.NET that is associated with Aspnet_regiis.exe and only registers ASP.NET in IIS.

https://support.microsoft.com/en-us/help/2015129/error-message-after-you-install-the--net-framework-4-0-could-not-load

Solution 2 - Iis

I have Windows 8 installed on my machine, and the aspnet_regiis.exe tool did not worked for me either.

The solution that worked for me is posted on this link, on the answer by Neha: https://stackoverflow.com/questions/4374639/system-servicemodel-activation-httpmodule-error/15523900#15523900

>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

Solution 3 - Iis

Hello Thanks for the question; To resolve: "Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'"

In Windows Features check all for .NET 4 Advanced Services & .NET 3.5

enter image description here

Just like Nicolas Gago I tried aspnet_regiis.exe -iru but it didn't work. After the features were on then it yellow screen error was gone. Thanks;

Solution 4 - Iis

You can install these features on windows server 2012 with powershell using the following commands:

Install-WindowsFeature -Name  NET-Framework-Features -IncludeAllSubFeature
Install-WindowsFeature -Name  NET-WCF-HTTP-Activation45 -IncludeAllSubFeature

You can get a list of features with the following command:

Get-WindowsFeature | Format-Table

Solution 5 - Iis

Ok, finally got it.

Change this line in %windir%\System32\inetsrv\Config\ApplicationHost.config

<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />

To

<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />

If this is not enough

Add this following line to the Web.config

<system.webServer>
  <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

Solution 6 - Iis

From the Server Manager's Features node, you can also remove some of the sub-items under the .NET Framework 3.5.1 Features that are installed by the activation of some of the other roles.

For instance, removed the WCF Activation Features as follows and our websites came back:

  • [x] .NET Framework 3.5.1 Features
    • [x] .NET Framework 3.5.1
    • [ ] WCF Activation
      • [ ] HTTP Activation
      • [ ] Non-HTTP Activation

Note: this did not require a restart for us.

Solution 7 - Iis

In Windows server 2012. Go to ISS -> Modules -> Remove the ServiceModel3-0.

Solution 8 - Iis

Details

http://msdn.microsoft.com/en-us/library/hh169179(v=nav.71).aspx

"This error can occur when there are multiple versions of the .NET Framework on the computer that is running IIS..."

Solution 9 - Iis

I got this error after I accidentally published one website into the directory of another website. The two websites had different versions of .net. What fixed it for me was changing the application pool. To do that, in the IIS manager:

click the website => Advanced Settings... (on the right) => click to the right of Application Pool => a button with "..." should appear => select ".NET v4.5 Classic"

If that application pool doesn't work, try some of the others.

Solution 10 - Iis

We are using a web service along side a web site and when we publish the web site it returns same this error. We found out that by going into IIS and removing the ServiceModel from Modules and the svc-Integrated from the Handler Mappings the error went away.

Solution 11 - Iis

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’

Solution 12 - Iis

You might changed the IIS features settings.The easy steps to resolve by open command prompt with run as administrator(For Windows Server 2008) and run the command C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru this will set up ASP.Net 4.0 ,Then Reset the IIS by the command iisreset

References: https://support.plesk.com/hc/en-us/articles/213392249-ASP-website-shows-error-Could-not-load-type-System-ServiceModel-Activation-HttpModule-from-assembly

Solution 13 - Iis

This issue occurs because the Applicationhost.config file for Windows Process Activation Service (WAS) has some tags that are not compatible with the .NET Framework 4.0.

Based on your environment, you have 4 workarounds to solve this issue:

  • Updating Applicationhost.config.
  • Perform ASP.NET IIS Registration.
  • Turn on the Named Pipe Activation feature.
  • Remove ServiceModel 3.0 from IIS

> Check the detailed steps for each woraround at Solving Could not load type system.servicemodel.activation.httpmodule from assembly System.ServiceModel

Solution 14 - Iis

delete the module which is identified in .Net error message , 1 down vote

In Windows server 2012. Go to ISS -> Modules -> Remove the ServiceModel3-0. (without number worked for me)

Solution 15 - Iis

start-> Run--> c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNicolas GagoView Question on Stackoverflow
Solution 1 - IisKishan ZunjareView Answer on Stackoverflow
Solution 2 - IisscubaFunView Answer on Stackoverflow
Solution 3 - IisCattoView Answer on Stackoverflow
Solution 4 - IisPreben HuybrechtsView Answer on Stackoverflow
Solution 5 - IisNicolas GagoView Answer on Stackoverflow
Solution 6 - IisfordarehView Answer on Stackoverflow
Solution 7 - IisNikolasKraschowetzView Answer on Stackoverflow
Solution 8 - IisJnnView Answer on Stackoverflow
Solution 9 - IisquickqView Answer on Stackoverflow
Solution 10 - IisMike DonnerView Answer on Stackoverflow
Solution 11 - IisTaranView Answer on Stackoverflow
Solution 12 - IisKailash MaliView Answer on Stackoverflow
Solution 13 - IisMohamedView Answer on Stackoverflow
Solution 14 - IispeterView Answer on Stackoverflow
Solution 15 - IisMukesh DepaniView Answer on Stackoverflow