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=220.127.116.11, 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=18.104.22.168, 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:
The aspnet_regiis.exe file can be found in either
- %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
Using aspnet_regiis -iru would also work.
Many, many thanks. The .NET being different for 32-bit and 64-bit catches me every time.
May the world praise your name until the sun itself envelopes the earth with a final fiery embrace. Thank you!!! You saved my Win7 install.
thanks. It helped me.
very very thanks