I am run aspnet_regiis.exe, still I am getting same error:
Jun 22, 2016 - Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
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′.
7 Answers
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
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.
Note: on a 64bit system you should use
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
):
Note: You can find the Applicationhost.config
file in the following location: %windir%system32inetsrvconfig
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:WindowsMicrosoft.NETFrameworkv4.0.30319andC:WindowsMicrosoft.NETFrameworkv2.0.50727
Get to the applicationhost.config file in the following directory:C:Windowssystem32inetsrvconfig
The following section will be defined:
The above definition is incompatible with the .NET framework 4.0, you can get this issue resolved by replacing the above section by the following:
To resolve this issue, run the following command line:
- aspnet_regiis.exe /iru The Aspnet_regiis.exe file can be found in oneof the following locations:%windir%Microsoft.NETFrameworkv4.0.30319%windir%Microsoft.NETFramework64v4.0.30319 (on a 64-bit computer)
To resolve this issue, run the following command line:
- Close the Application
- in the project file(Web Application) change the virtual directory
- Now OPEN the Project file
It will work definitely.
On Windows 2012, the following worked :
For a reason I don't know the default application pool was set up to use 4.0 :
but it was not correctly reflected in c:windowssystem32inetesrvconfigapplicationhost.config :
I had to set it back to 2.0 and then to 4.0 again, and then the config file was fine and the error disapeared :
Not the answer you're looking for? Browse other questions tagged asp.netiis or ask your own question.
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 ?
12 Answers
Try with
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.
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: 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
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
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;
You can install these features on windows server 2012 with powershell using the following commands:
You can get a list of features with the following command:
Ok, finally got it.
Change this line in System32/ApplicationHost.config
To
If this is not enough
Add this following line to the Web.config
In Windows server 2012. Go to ISS -> Modules -> Remove the ServiceModel3-0.
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.
Details
'This error can occur when there are multiple versions of the .NET Framework on the computer that is running 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.
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.
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)
start-> Run-->c:WINDOWSMicrosoft.NETFrameworkv4.0.30319aspnet_regiis.exe -iru
protected by Community♦Dec 17 '18 at 22:29
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?