From:http://support.microsoft.com/kb/2015129
Symptoms
Consider the following scenario. Younbsp;install the .NET Framework 4.0. Then, younbsp;install an earlier version of the .NET Framework, or you enablenbsp;.NET 3.0 WCF HTTP Activation. In this scenario, you may receive the followingnbsp;error message when you when runnbsp;applications that are hosted on Internet Information Services (IIS):
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.nbsp; 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'.
nbsp;
Cause
This issue occurs because the Applicationhost.config file for Windows Process Activation Service (WAS) has the following section defined, and this section is incompatible with the .NETnbsp;Frameworknbsp;4.0:
lt;add name=quot;ServiceModelquot; type=quot;System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089quot; preCondition=quot;managedHandlerquot; /gt;
This section should be defined as follows:
lt;add name=quot;ServiceModelquot; type=quot;System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089quot; preCondition=quot;managedHandler,runtimeVersionv2.0quot; /gt;
Notenbsp;You can find the Applicationhost.config file in the following location:
%windir%system32inetsrvconfig
nbsp;
Resolution
To resolve this issue,nbsp;run the following command line:nbsp;
aspnet_regiis.exe /iru
The Aspnet_regiis.exe file can be found in one of the following locations:
%windir%Microsoft.NETFrameworkv4.0.30319
%windir%Microsoft.NETFramework64v4.0.30319 (on a 64-bit computer)
nbsp;
注意
以上方案在win8系统中无效,因为在最后一步运行nbsp;aspnet_regiis.exe /iru 命令时会失败,所以解决方案是找到nbsp;Applicationhost.config 文件(目录在%windir%system32inetsrvconfig),然后把文件中的:
lt;add name=quot;ServiceModelquot; type=quot;System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089quot; preCondition=quot;managedHandlerquot; /gt;
改为:
lt;add name=quot;ServiceModelquot; type=quot;System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089quot; preCondition=quot;managedHandler,runtimeVersionv2.0quot; /gt;
我目前只找到这种方案,如果有更好方案欢迎指出。
作者:Artwl 出处:http://artwl.cnblogs.com (编辑:源码网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|