ITPub博客

首页 > Linux操作系统 > Linux操作系统 > IIS - Could not load type System.ServiceModel.Activation.HttpModule

IIS - Could not load type System.ServiceModel.Activation.HttpModule

原创 Linux操作系统 作者:kevin_1229 时间:2014-12-02 13:14:46 0 删除 编辑

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

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:

  This section should be defined as follows:

  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),然后把文件中的:

  改为:

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/557324/viewspace-1353859/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-08-28

  • 博文量
    22
  • 访问量
    44043