If you install DotNet framework 4.0 on Windows Server 2008 or R2 after enabling IIS, you might see following error when browse your application site made of ASP.NET 4.0 (or run on ASP.NET 4.0 application pool).
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’.
Cause & Solution
If IIS is enabled after DotNet 4 installation then ASP.NET is not registered with IIS. You will see the error if your site is targeting ASP.NET 4. To resolve this issue, run the following from elevated command line to register ASP.NET 4:
aspnet_regiis.exe /iru
The aspnet_regiis.exe file can be found in either
- %windir%Microsoft.NETFrameworkv4.0.30319
- %windir%Microsoft.NETFramework64v4.0.30319 (on a 64-bit machine)
More info for ASP.NET IIS Registration Tool (Aspnet_regiis.exe) can be found at http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx
It works.
Remember to run CMD as Administrator.
Thanks
Thanks for sharing this nightmare with us.
It worked great! Thank you!
Thank you very much, worked perfectly!
thanks
this also fixed mine i installed everything correctly and then installed sharepoint and that messed things up for me
but this fixed it
thanks
Thanx, It was solved my problem
Pingback:Setup WebGitNet | Heal My SCM
thanx it solved my problem.
Brilliant. If only I searched this error code earlier. Thank you so much!
On a pretty much virgin Win7 box I installed nodejs and iisnode (and the URL rewrite extension) following to the letter the instructions listed here (https://github.com/tjanczuk/iisnode). When I tried to run up the node server (http://localhost/node) I got this exact same error. Since Emma didn’t mention anything about node or any of these modules, I wasn’t hopeful this fix would work…
So Emma, you’ll be pleased to know, it worked.
THANK YOU.
thanks aaa lot ……
it was really really helpful. thanks a lot!
thanks, it was driving me nuts.
worked! thanks
Thank you
Thanks !
Thanks This worked for me. saved me some hassles.
After trying the above instructions till i got error “The server committed a protocol violation. Section=ResponseStatusLine”
anybody know the solution please help me..
when i try to run the service in wcftestclient it returns error “Error: Cannot obtain Metadata from http://localhost/Aivea.Acs.ServicesHost/Aivea.Acs.Services.ShopService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://localhost/Aivea.Acs.ServicesHost/Aivea.Acs.Services.ShopService.svc Metadata contains a reference that cannot be resolved: ‘http://localhost/Aivea.Acs.ServicesHost/Aivea.Acs.Services.ShopService.svc’. The server committed a protocol violation. Section=ResponseStatusLineHTTP GET Error URI: http://localhost/Aivea.Acs.ServicesHost/Aivea.Acs.Services.ShopService.svc There was an error downloading ‘http://localhost/Aivea.Acs.ServicesHost/Aivea.Acs.Services.ShopService.svc’. The request failed with HTTP status 404: Not Found.”
thanks, that helped
wonderful!! Problem solved in 30 seconds 🙂 thank you very much sir!
Thanks,Great
It did a great job.
Thanks…
Thanks, this saved me a good bit of time.
Awseome! Fixed in no time! Much appreciated!