广告
返回顶部
首页 > 资讯 > 操作系统 >win8 Could not load type System.ServiceModel.Activation.HttpModule 错误解决方案
  • 432
分享到

win8 Could not load type System.ServiceModel.Activation.HttpModule 错误解决方案

解决方案错误type 2022-06-04 19:06:17 432人浏览 薄情痞子
摘要

From:Http://support.microsoft.com/kb/2015129 Symptoms   Consider the following scenario. You install th

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

Symptoms

  Consider the following scenario. You install the .net Framework 4.0. Then, you install an earlier version of the .NET Framework, or you enable .NET 3.0 WCF HTTP Activation. In this scenario, you may receive the following error message when you when run 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'.
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 .NET Framework 4.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" />

  Note You 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

--结束END--

本文标题: win8 Could not load type System.ServiceModel.Activation.HttpModule 错误解决方案

本文链接: https://www.lsjlt.com/news/16730.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作