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

could not load type global.asax iis
could not load type from assembly
could not load type test page global
could not load type presentation global
could not load type consumer global_asax
could not load type site1
parser error message could not load type '_default'
could not load type index

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 ?

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

Parser Error Message: Could not load type 'webmarketing', I had same problem before i just change CodeBehind to CodeFile and it worked.I remember it works in local but i had this problem after  Could not load type 'Intel.Intel'. I copied my entire Visual Studio 2010 folder before I formatted my computer and I copy/replaced the same folder with this one after I installed windows again. I'm running this locally not on a host server.

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

Tip: "Parser Error: Could not load type", I hope this post can save someone hours of frustration! If, in your application, you want to have subfolders and in those, .aspx pages, you will  Could not load type “. error in DotNet object. As often a solution to a strange error is so simple when you know it. When I copied my add-ins to a new computer I was not able compile the objects that included DotNet add-ins. As this happened when I was installing NAV 2013 R2 for the first time my first thought was that this was something that had changed between versions and I sent a support request to Microsoft.

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;

Fix Could not load type Inherits Exception, In this video article i will show you , how to fix could not type inherits error/​exception. Actually Duration: 2:12 Posted: Apr 13, 2016 Also try changing CodeBehind="TestCert.aspx.cs" to CodeFile="TestCert.aspx.cs". This change is required when you change project type from website to webapplication or vice versa. Since you are saying that the project does not contain the project file or solution file, I think the problem is here. The IIS is not able to understand the project type.

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

ASP.NET CodeBehind error "Could not load type" when adding a , Parser Error Message: Could not load type 'NopSolutions.NopCommerce.Web.​Testing._default'. Source Error: Line 1: <%@ Page Language="C#"  Your local web server is running different code than what you're actually working on. Ensure you have stopped debugging, stop your local web server, clean and rebuild as Peter suggested, double-check your global.asax and global.asax.cs, and try again.

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>

Could not load type 'SitefinityWebApp.ConfigMigration' · Issue #1 , Parser Error Message: Could not load type 'SitefinityWebApp.ConfigMigration'. Source Error: Line 1: <%@ Page Language="C#"  Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. Could not load type

Solved:Parser Error Message: Could not load type OpenAuth , Parser Error Message: Could not load type 'OpenAuth.MvcApplication'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.cs"  Connect-AzureAD Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly #10473 Closed aollivierre opened this issue Sep 1, 2019 · 24 comments

Parser Error Message: Could not load type, Parser Error Message: Could not load type. Posted 11 years ago2009-04-21T23:​43:35+08:00 by Ajay Matharu. Updated 1 month ago2020-04-24T21:34:53+08:  Solution 1. Accept Solution Reject Solution. Hide Copy Code. find "adodb" in references and see adodb.dll properties. "Embeded Interop Types" set to false than you can set "Copy Local" to true . Permalink.

Parser Error: Could not load type, Parser Error: Could not load type Problem. An error occurred during the parsing of a resource required to service this request, e.g.: Configuration Error.

Comments
  • also we can user CMD : by entering address , cd\Windows\Microsoft.NET\Framework64\v4.0.30319 and then install it by : aspnet_regiis.exe -iru command , next it would be better to restart ISS by iisreset
  • This is still proving helpful today. I would have hoped by now MS would have fixed this. In my case, we already have a running IIS application using ASP.net 4.0 framework. While not exactly sure what the customer did other than to upgrade to 4.5.1 and a bunch of other updates, it became necessary to re-run this command, something our support engineers didn't think of because they haven't had to do it for some time.
  • thanks for the answer. this, however, did not work for me. but enabling everything under '.Net Framework 3.5' and '.Net Framework 4.5' in windows features (as mentioned in below answers) did the trick.
  • I have a windows server 2008 x64 R2 and it worked fine but after one month , I got this error,I found this post and run this command on my server and it fixed my issue. I never install or update anything on my server, now the question is why did it happen?, is it normal or it's a hack type or something like that?
  • It's worked for me only if I run aspnet_regiis.exe -iru for v4.0.XXXXX AND v2.0.XXXXX versions!
  • This advice is also necessary for Windows Server 2012.
  • Thanks for passing this along. Worked great to fix this on Win 8.1
  • You don't need to enable everything, just Http Activation!
  • What Marius said, just Http Activation under .NET 3.5 Features
  • You & Neha saved my remaining hairs
  • This worked for me in Windows Server 2012 R2 - thanks!
  • Same for Windows 8. Thank you!
  • This fixed Win8 for me. Thanks! +1
  • I only had to enable "Http Activation" as I hosted the services in IIS. It worked for me, thanks.