none
Sudden Error: Could not load type System.ServiceModel.Activation.HttpModule - Urgent Help Please

    Question

  • hi,

    I have a windows 7 machine with IIS 7. I was hosting WCF services on IIS normally and i had a couple of services running.
    Suddenly (i honestly did not do any configuration changes on my machine) all these services stopped working. When i try to browse the .svc file i get the following error:


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

    Just in case this information is helpful, all these services are running on the basicHttpBinding.

    Please help!
    Friday, December 04, 2009 9:30 PM

Answers

  • Not sure if this applies to your problem but it is the same error (copied from http://download.microsoft.com/download/0/A/E/0AEB3BC1-506E-4954-8AB1-4FA2EE75985C/ReleaseNotes.docx):

    Could Not Load Type ‘System.ServiceModel.Activation.HttpModule’

    When attempting to run a service that receives messages over the HTTP transport, you may receive an error similar to the following:

    Server Error in '/WCFApplication' Application

    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. 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'.

    This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.

    To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:

    aspnet_regiis.exe -iru

    • Marked as answer by mhalabi Friday, December 04, 2009 10:22 PM
    Friday, December 04, 2009 10:00 PM

All replies

  • by the way, dll System.ServiceModel is available in the GAC with the correct token!

    Friday, December 04, 2009 9:37 PM
  • Not sure if this applies to your problem but it is the same error (copied from http://download.microsoft.com/download/0/A/E/0AEB3BC1-506E-4954-8AB1-4FA2EE75985C/ReleaseNotes.docx):

    Could Not Load Type ‘System.ServiceModel.Activation.HttpModule’

    When attempting to run a service that receives messages over the HTTP transport, you may receive an error similar to the following:

    Server Error in '/WCFApplication' Application

    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. 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'.

    This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.

    To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:

    aspnet_regiis.exe -iru

    • Marked as answer by mhalabi Friday, December 04, 2009 10:22 PM
    Friday, December 04, 2009 10:00 PM
  • Bruno,

    many thanks buddy, that solved my problem.

    i still do not know what caused the issue in the first place because everything was working and i did not change a thing...anyway i will live with that :)
    thnx again
    Friday, December 04, 2009 10:25 PM
  • No problem, glad I could help.
    Friday, December 04, 2009 10:26 PM
  • Ditto the big thanks to you Bruno - saved the day
    Friday, April 23, 2010 4:17 AM
  • I ran into the same problem.

     

    ENV = Lab/Test usage on Win2008 Ent R2 x64.

    Test app = VS2010 MVC sample app with ASPNET SQLREG setup and working well.

    Then I added some new features into the server and that's been it broken.  Seems to be very touchy with the feature change config.  I would like to see more intelligence in the feature installer to ensure I don't break anything.

     

    aspnet_regiis.exe -iru fixed my issue.

     

    Thanks,

     

    Tony

     

     

    Tuesday, May 11, 2010 5:24 PM
  • I happened to run ServiceModelReg.exe of v3.0 and all my ASP.NET 4.0 websites crashed. Your solution works! Many thanks.
    Sunday, May 16, 2010 3:24 PM
  • Saved me too.  I was about to sweep a pc.!
    Love, praise, and worship God :)
    Saturday, May 22, 2010 10:57 PM
  • Thanks a lot, this saved me too!
    C# + BizTalk2009 Developer
    Wednesday, August 04, 2010 8:13 PM
  • Many many thanks, Bruno!!
    Sunday, August 08, 2010 5:32 AM
  • Many thanks.

    I don't know if it's mentioned in previous posts, but I want to add following thing: you should run "aspnet_regiss.exe" under Administrator Right, otherwise you still get the error.


    Next time when you think you're perfect, try to walk on the water!
    Friday, August 13, 2010 3:33 PM
  • yep you can do that ...but win 7 did not give me that option as running aspnet_regiis.exe  ran too fast --- so
    if you want just REPAIR - > the  Microsoft .NET Framework 4

    if you installed Microsoft .NET Framework 4 with the web platform installer you will probably have to download
    Microsoft .NET Framework 4 again ...search it.. then when you "install" select REPAIR ...then every thing comes up roses !
    Thursday, September 23, 2010 2:26 AM
  • Tons of Thanks Buddy. Ditto Helped.

     

    Thanks

    Jaitley

    Friday, October 08, 2010 5:20 AM
  • Solved my issue too, thanks!!

     

    As far as I remember, I'd installed a CTP related to Entity Framework POCO / code-first, and this is the first time I tried to run the site since then...

    Monday, October 11, 2010 11:14 AM
  • Not sure if this applies to your problem but it is the same error (copied from http://download.microsoft.com/download/0/A/E/0AEB3BC1-506E-4954-8AB1-4FA2EE75985C/ReleaseNotes.docx):

    Could Not Load Type ‘System.ServiceModel.Activation.HttpModule’

    When attempting to run a service that receives messages over the HTTP transport, you may receive an error similar to the following:

    Server Error in '/WCFApplication' Application

    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. 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'.

    This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.

    To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:

    aspnet_regiis.exe -iru


    Correct. Problem solved. JCruz
    Monday, November 01, 2010 10:55 AM
  • Thank you very much.  Yes, I did install WCF HTTP Activation after installing IIS.  This is good to know.
    Sunday, November 21, 2010 1:33 AM
  • Great Sir,thank you so much...
    Tuesday, December 07, 2010 9:35 AM
  • Thanks big time!!
    Wednesday, December 15, 2010 7:15 PM
  • yes, it works, thanks.
    Monday, January 03, 2011 11:12 PM
  • Since there are likely several aspnet_regiis.exe executables on your system, this additional note may be helpful:

    NOTE: When running aspnet_regiis.exe, you must ensure that you run the version supplied with the .NET Framework version that you want to use. The .NET Framework 4 version of aspnet_regIIS.exe is located in the following path(s):

    • 32-bit systems: %SystemRoot%\Microsoft.NET\Framework\v4.0.30319
    • 64-bit systems: %SystemRoot%\Microsoft.NET\Framework64\v4.0.30319
    Version current as of 1/25/2011
    Tuesday, January 25, 2011 3:58 PM
  • Hi Bruno wouters,
    Thanks. It sounds great. I am new to WCF. You have helped me a lot. Thank you.
    Wednesday, March 02, 2011 11:24 AM
  • Thanks a lot.
    Tuesday, March 22, 2011 2:49 PM
  • Tnx a lot.you have saved me!
    Wednesday, March 30, 2011 9:15 AM
  • Thanks a lot.............

    I faced the same after installing Sharepoint 2010, i don't know the exact reason. Anyway thanks.

    aspnet_regiis.exe -iru  Solved the issue...........


    Regards, Surya
    Friday, April 29, 2011 6:40 AM
  • Thank Bruno,

    aspnet_regiis.exe -iru 

    perfect answer

    Monday, May 30, 2011 3:12 AM
  • Thanks... it helps so much
    Saturday, June 18, 2011 12:12 PM
  • Thanks very much!! Stumbling upon this post has just resolved a couple of hours head-scratching

    Wednesday, June 29, 2011 5:47 PM
  • aspnet_regiis.exe -iru solved my problem too! 

    Thanks!!

    Thursday, June 30, 2011 6:41 PM
  • Thanks Bruno

    I faced same problem while accessing the WCF service.

    I have executed the command as you mentioned in the document.

    After that it is working fine.

     

    Thanks a lot.

    Monday, July 18, 2011 11:01 AM
  • Bruno, Thank you for the heads up on this. I ran across this during my OpsMgr 2012 testing. Ran it the command and happy as a can be.

     

     

    Thursday, July 28, 2011 7:12 PM
  • Спасибо. Реально помогло. Я запускал на SBS 2011 - а это 64 бит ОС. Однако запускал по этому пути: 32-bit systems: %SystemRoot%\Microsoft.NET\Framework\v4.0.30319

    32-bit systems: %SystemRoot%\Microsoft.NET\Framework64\v4.0.30319 - получал ошибку - приложение не win32.

    Спасибо.

    Вот теперь и не знаю что думать про SBS, ожидал, что там ВСЁ настроено, и готово к эксплуатации.

    Tuesday, August 09, 2011 12:08 PM
  • Everything was workign fine. And suddenly i started getting this error.

    I just restarted IIS and it started working for me. Phew!

    Friday, August 12, 2011 9:00 PM
  • Not sure if this applies to your problem but it is the same error (copied from http://download.microsoft.com/download/0/A/E/0AEB3BC1-506E-4954-8AB1-4FA2EE75985C/ReleaseNotes.docx):

    Could Not Load Type ‘System.ServiceModel.Activation.HttpModule’

    When attempting to run a service that receives messages over the HTTP transport, you may receive an error similar to the following:

    Server Error in '/WCFApplication' Application

    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. 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'.

    This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.

    To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:

    aspnet_regiis.exe -iru


    • Proposed as answer by Cengiz Kuskaya Sunday, August 21, 2011 6:51 PM
    • Unproposed as answer by Cengiz Kuskaya Sunday, August 21, 2011 6:51 PM
    Sunday, August 21, 2011 6:50 PM
  • Thank you for this post !!   I had installed 3.5 on Windows 2008 and then had to re-run aspnet_regiis -iru to get framework 4 working again.
    Friday, August 26, 2011 4:52 PM
  • Hi Bruno,

     

    Many thanks for the suggestion, it's people like you that keep the non-techies safe in this world!

     

    Aad

    Monday, August 29, 2011 7:13 AM
  • Thanks a lot, solved my issue, I was having issue while creating an MVC application. but 

    aspnet_regiis.exe -iru

    solved my issue


    Thanks & Regards Sumit Gupta
    Monday, September 12, 2011 9:23 AM
  • Phew, skin saved, system outage of about 90 seconds.

    In my scenario it was enabling Application Server role on Win2008... the addition of .net3.5 stuff threw out the registration of .net4.

    • Edited by jimbob456456 Friday, September 30, 2011 11:00 AM
    Friday, September 30, 2011 10:59 AM
  • Thanks
    Frank Xu Lei--谦卑若愚,好学若饥
    专注于.NET平台下分布式应用系统开发和企业应用系统集成
    Focus on Distributed Applications Development and EAI based on .NET
     

    老徐的网站】:http://www.frankxulei.com/

    微软WCF中文技术论坛
    微软WCF英文技术论坛

    Windows Azure中文技术论坛

    Wednesday, October 05, 2011 12:02 PM
  • Thanks alot. You saved my day.
    Thursday, December 15, 2011 11:55 AM
  • Yes, thank you very much Bruno.  By looking at the replies, you saved many hours of frustration for many folks for many months.
    Thursday, December 29, 2011 8:35 PM
  • I got this error while running a sample application in the Windows Azure SDK emulator.

    Thank you so much!!!

    For others, the aspnet_regiis.exe can be located as follows:

    The tool for 64-bit systems in located in the Framework64 directory of the Microsoft.NET directory inside the Windows folder; for example C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727 would contain the IIS Registration Tool.

    Thanks,

    Sandeep.

    Friday, January 06, 2012 8:34 PM
  • Thanks Bruno. You saved me a lot of grief. - cheers
    Saturday, January 07, 2012 10:27 AM
  • Solved my problem,

     

    Thanks

    Shiv Guddadmath

    Monday, January 09, 2012 11:25 AM
  • Worked Perfectly. Good find.
    Wednesday, February 01, 2012 7:45 PM
  • Thanks so much. solved my problem
    Tuesday, February 21, 2012 11:41 PM
  • Thanks a million Bruno.  Worked like a charm.  Now I can get to DevCamp prepared
    Thursday, April 19, 2012 7:16 PM
  • It worked for me too..
    Monday, April 30, 2012 2:59 PM
  • Great!! you saved my life..
    Thursday, May 17, 2012 11:42 AM
  • Thanks Bruno, worked like a charm
    Tuesday, May 29, 2012 9:43 PM
  • Worked for me too !

    Thank you :-)

    Friday, July 13, 2012 3:50 PM
  • Thanks your help....!
    Tuesday, September 18, 2012 12:30 PM
  • This fix won't work on Windows 8 since aspnet_regiis.exe won't run on it.  

    For Windows 8, you have to go to Windows features and enable everything under ".Net Framework 3.5" and ".Net Framework 4.5 Advanced Services".  

    For more on what else I tried that didnt work, see http://blog.josh.mouch.name/?p=138">.

    Thursday, October 25, 2012 3:14 PM
  • I realize this is very old and you may not get this... but unfortunately this didn't help me and everywhere I see this issue listed in various forums this is always the thing to do and it always works but it didn't for me. I ran the aspnet_regiis.exe -iru command and it finished properly but then my problem persists. Each time I run the app I get the same error in the browser.

    I am running VS2010 on Windows 7 32-bit. I don't have IIS or IISExpress installed and am only using the built in VS2010 Webserver for development. I found an answer somewhere else that said to modify the applicationhost.config file and I don't have that file since I don't have IIS.

    Any other ideas on how to solve this issue?

    Thanks,

    Scott

    Wednesday, November 14, 2012 4:18 PM
  • This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:
    aspnet_regiis.exe -iru

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

    Deepak_K

    • Proposed as answer by Deepak_K Sunday, January 06, 2013 6:42 PM
    Sunday, January 06, 2013 6:41 PM
  • I did all the suggestions and it didnt work for me. (Server: 2008 IIS 7.5)

    i solved this as below

    go to IIS -> to your website -> switch to features view

    go to Modules removed ServiceModel (whcih points to 3.0.0.0)

    go to HandlerMappints removed svc-integrated (whcih points to 3.0.0.0) 

    It worked for me. Hope this will help some one

    THanks

    gvnspk

    • Proposed as answer by gvnspk Thursday, August 22, 2013 6:41 PM
    Thursday, August 22, 2013 6:41 PM
  • I served your help.

    and also add another controller, with the following characteristics.

    Path: *. Svc
    Type: System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35
    Name: svc-Integrated-4.0

    Thank you!
    Thursday, October 17, 2013 6:28 PM
  • Just to add information to this. For Windows 8 and 8.1 you need to use the Windows Features to modify the installation in order to get WCF working as per above. aspnet_regiis -iru doesn't work as per previuos versions.
    Tuesday, December 03, 2013 9:54 AM
  • Just going to add this just seems like something for asp.net 4. Also the aspnet_regiis.exe file seems to be in the c:/windows/microsoft.net folder somewhere. Something everyone here just seems to know. So you have to navigate to that folder first before you run the command.
    Monday, December 23, 2013 8:59 PM
  • >I did all the suggestions and it didnt work for me. (Server: 2008 IIS 7.5)

    >i solved this as below

    >go to IIS -> to your website -> switch to features view

    >go to Modules removed ServiceModel (whcih points to 3.0.0.0)

    >go to HandlerMappints removed svc-integrated (whcih points to 3.0.0.0) 

    >It worked for me. Hope this will help some one

    >THanks

    >gvnspk

    This worked for me. So to build on gvnspk's post I opened IIS manager. I expanded the left hand side sites folder until I got to my site. Then I was already in features view by default. In the middle pane I clicked on modules. Then I clicked on ServiceModule and clicked "remove".

    I did not find a HandlerMappints. I am running on Windows 8.1


    • Edited by obesechicken13 Monday, December 23, 2013 9:13 PM added quote.
    Monday, December 23, 2013 9:11 PM
  • Just to add information to this. For Windows 8 and 8.1 you need to use the Windows Features to modify the installation in order to get WCF working as per above. aspnet_regiis -iru doesn't work as per previuos versions.
    So how exactly you fix this on Windows 8 and 8.1... ???
    Friday, January 10, 2014 2:01 PM
  • On IIS8 on Windows Server 2012, check & install "HTTP Activation" under ".NET Framework 3.5 Features" to resolve this issue. I would assume the same applies to Win8
    Monday, January 20, 2014 3:09 PM
  • Thanks a lot, it works. :)
    Tuesday, January 28, 2014 8:22 PM