手机
当前位置:查字典教程网 >操作系统 >Windows系列 >win8 Could not load type System.ServiceModel.Activation.HttpModule 错误解决方案
win8 Could not load type System.ServiceModel.Activation.HttpModule 错误解决方案
摘要:From:http://support.microsoft.com/kb/2015129SymptomsConsiderthefollowi...

From:http://support.microsoft.com/kb/2015129

Symptoms

Consider the following scenario. Youinstall the .NET Framework 4.0. Then, youinstall an earlier version of the .NET Framework, or you enable.NET 3.0 WCF HTTP Activation. In this scenario, you may receive the followingerror message when you when runapplications 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'.

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

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 .NETFramework4.0:

<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />

This section should be defined as follows:

<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />

NoteYou can find the Applicationhost.config file in the following location:

%windir%system32inetsrvconfig

Resolution

To resolve this issue,run the following command line:

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)

注意

以上方案在win8系统中无效,因为在最后一步运行aspnet_regiis.exe /iru 命令时会失败,所以解决方案是找到Applicationhost.config 文件(目录在%windir%system32inetsrvconfig),然后把文件中的:

<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />

改为:

<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />

我目前只找到这种方案,如果有更好方案欢迎指出。

作者:Artwl

出处:http://artwl.cnblogs.com

【win8 Could not load type System.ServiceModel.Activation.HttpModule 错误解决方案】相关文章:

win7旗舰版升级到win10系统后卡在logo界面解决方法

获取Win10升级工具将在7月29日后自动卸载

Win10 Mobile一周年更新预览版14393.105面向慢速预览通道

win10一周年更新预览版1607应用商店消失了该怎么恢复?

win10系统无法启动BarTender提示丢失mfc100u.dll的解决方法

win10系统安装aspx运行环境步骤图解

Win7系统开机黑屏提示system halted的故障原因及解决方法

Win10一周年更新正式版首个累积更新补丁KB3176495开始推送

Win10预览版14383自制ISO镜像下载 32位/64位

Win10手机连接不上电脑没反应怎么解决

精品推荐
分类导航