zoukankan      html  css  js  c++  java
  • IIS7 上部署MVC3,执行错误:Could not load type 'System.ServiceModel.Activation.HttpModule'

    在win2008的iis7.5上安装和部署MVC3应用程序,运行时错误:

    Server Error in '/' Application.


    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'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [TypeLoadException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
       System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
       System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +314
       System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +95
       System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +124
       System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +76
    
    [ConfigurationErrorsException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
       System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +11516844
       System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +69
       System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +62
       System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +264
       System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1356
       Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleReflectionUtil.GetIntegratedModuleCollection(HttpApplication target, IntPtr appContext) +34
       Microsoft.Web.Infrastructure.DynamicModuleHelper.CriticalStatics.Init(HttpApplication context) +269
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +575
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375
    
    [HttpException (0x80004005): Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11686912
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4863733
    

     


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

    原因:在iis7或其他原.net 3.5的iis环境上安装.net4或更高版本后,没有更新注册

    解决方案:

    以.NET 4.0环境为例,执行以下Command:

    cd "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"

    aspnet_regiis.exe -iru

    引用:

    http://social.msdn.microsoft.com/Forums/en/wcf/thread/39571e42-aca7-469d-8c68-aa59c2da4fcc

  • 相关阅读:
    DCR挖矿成本¥355.92,市价¥346.24——五大币种挖矿成本分析 2018-08-7
    智者见智——区块链3.0与未来
    梭哈10万入场,拿住不放,3年后收益过十亿,币圈传奇—大空翼
    从路人甲到叱咤币圈的神话:“打死也不卖币”的宝二爷
    小白眼里的区块链和币圈 —— 持币待涨的故事
    区块链如何赋能网络互助行业?来自众托帮+区块链的应用、车车助+纷享车链AutoChain应用
    中国青年网记者-阿里巴巴王坚:互联网已成为世界发展的基础设施
    读者咩叭:畅谈经济未来
    中青网财经:请一位心理学博士当CTO 只有马云敢这么做
    云科技时代:阿里云创造者写了《在线》,这是一本怎样的书?
  • 原文地址:https://www.cnblogs.com/rynnwang/p/2477099.html
Copyright © 2011-2022 走看看