+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Could not load type 'System.ServiceModel.Activation.HttpModule' Sitefinity 4.0 Beta 2

Could not load type 'System.ServiceModel.Activation.HttpModule' Sitefinity 4.0 Beta 2

10 posts, 0 answered
  1. Bryan
    Bryan avatar
    62 posts
    Registered:
    20 Jul 2010
    08 Oct 2010
    Link to this post
    I am getting the following error when I upgraded from Sitefinity 4.0 Beta to 4.0 Beta 2:

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

    I have updated the app pool in IIS to use a .NET 4.0 app pool.  In the web.config I do not see where this assembly is being referenced.

    Any ideas?

    Thanks,
    Bryan
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Oct 2010
    Link to this post
    Hello Bryan,

    Could you check whether your project has a reference to System.ServiceModel v4.0.30319. It looks like you have a reference to System.ServiceModel v 3.0.0.0.

    By default the assembly should be located inside C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.ServiceModel.dll

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Bryan
    Bryan avatar
    62 posts
    Registered:
    20 Jul 2010
    11 Oct 2010
    Link to this post
    Hey Ivan,

    I verified that my project in VS2010 is referencing the correct libraries:
    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.ServiceModel.dll

    What is interesting is when I run a clean install of Sitefinity 4 Beta 2 in the built in web server it works.  However, when I run it under my local IIS 7 I get this error.  I have combed over my local IIS configuration and everything is set up for a .NET 4.0 application.  Very confusing.

    Thanks,
    Bryan
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Oct 2010
    Link to this post
    Hello Bryan,

    Somewhere you are adding a reference to a wrong version of System.ServiceModel.dll and this is what the error complains. Check the project web.config when you host the application in IIS and all references. Make sure that there is no some setting for auto update that changes the assembly references when you have several versions of .NET Framework installed on the same machine.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Bryan
    Bryan avatar
    62 posts
    Registered:
    20 Jul 2010
    11 Oct 2010
    Link to this post
    Hey Ivan,

    Your support, professionalism and patience are great!

    Might I suggest a troubleshooting step for you to include in your support replies:

    "Step 1:  reboot your computer/server"
    [...]

    So, yes, I went through every config I knew of.  Combed through my IIS settings and even changed the .NET Framework version at my localhost server level and nothing worked.

    So, with my tail between my legs, I reluctantly allowed windows to apply the updates it has been complaining about for the last week then I went to lunch.  When I returned I rebooted my computer, fired up VS, rebuilt and voila!  It's working.

    In my many years working on a windows machine you would think I would have known to reboot as a first rather than last resort :-).

    Thanks for your help.
    Bryan
  6. Jason Green
    Jason Green avatar
    53 posts
    Registered:
    18 Sep 2009
    10 Jan 2011
    Link to this post
    I was getting this error too - but couldn't get around it.

    Finally re-registering .net 4.0 in IIS worked:
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -i


  7. SENTHIL
    SENTHIL avatar
    1 posts
    Registered:
    16 Mar 2011
    16 Mar 2011
    Link to this post
    Excellent Jason!

    aspnet_regiis -i worked!
  8. Phil C
    Phil C avatar
    28 posts
    Registered:
    06 Sep 2012
    19 Apr 2011
    Link to this post
    Same here, cheers! You can also use aspnet_regiis -iru to avoid applying it to all the other sites.
  9. Gunnar
    Gunnar avatar
    10 posts
    Registered:
    30 Sep 2008
    16 Mar 2012
    Link to this post
    Yeahh ... Beautiful! I had been struggling with this now for one day, wondering if Bill was pulling my leg again ;.)
    I did exactly the re-registering of .net 4.0 in IIS 7.5, and voila. My SF 4.4 incl. the new fresh installation of SF 5.0 is working flawlessly. A little slow to start with but getting along better as caching starts getting effective.

    Rgds/Gunnar
  10. Aboorvaraja
    Aboorvaraja avatar
    1 posts
    Registered:
    23 Feb 2016
    23 Feb in reply to Bryan
    Link to this post

    This post will help you.

     

    http://www.codeproject.com/Articles/613812/Solve-IIS-Error-Could-not-load-type-System-Servi 

     

10 posts, 0 answered