2013-08-25 42 views
0

有很多問題回答這個問題,但沒有答案爲我工作。IIS8:無法加載類型'System.ServiceModel.Activation.HttpModule'

最初,當我試圖對PUTDELETE(可能還有其他動詞)時,我得到了405。看一些問題,解決方案似乎是改變處理程序映射。

我改變了以下內容:

ExtensionlessUrlHandler-ISAPI-4.0_32bit 
ExtensionlessUrlHandler-ISAPI-4.0_64bit 
WebDAV 

我注意到動詞已經在One of the following verbs箱,所以在絕望中我改變了它接受所有動詞。

現在,我甚至無法加載網頁,更不用說像DELETE任何奇異的請求,我立即得到死亡的黃屏:

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, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0 
    System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +153 
    System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +100 
    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) +12687536 
    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) +66 
    System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +300 
    System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1262 
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +133 
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304 
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404 
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475 

[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) +12881108 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159 
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722297 

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

到目前爲止,我有:

  1. 經過ASP.NET 4.5通過Web PI安裝
  2. 運行dism /online /enable-feature /featurename:IIS-ASPNET45
  3. 運行"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r
  4. 運行C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -I
  5. 更多iisreset比我能可能
  6. applicationHost.config更換ServiceModel

    <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,runtimeVersionv4.0" /> 

我還能做什麼,或者我應該在哪裏看?

感謝

戴夫

回答

3

你也要/在線激活servicemodel 4.0 DISM /使能功能/所有/ FeatureName:WCF-HTTP-Activation45

,並在德IIS管理器(服務器 - >功能 - >模塊) 檢查是否看到servicemodel 4.0,然後刪除servicemodel。

+0

「/ all」標誌有所不同。 – 3d0

2

在我的計算機上安裝Synfusion Essential Studio後,我遇到了同樣的問題。 我決定通過執行以下步驟:

  1. 打開IIS管理控制檯
  2. 在Server面板到模組,功能視圖
  3. 確保ServiceModule-4.0是存在的。如果它不存在,執行上述(1-6)規定的步驟
  4. 刪除ServiceModel模塊
1

只是想這可能幫助別人。

如果運行IIS的計算機上有多個.NET Framework版本,並且在.NET Framework 4.0或Windows Communication Foundation的服務模型註冊之前安裝了IIS,則會發生此錯誤。

這裏是解決這個問題的鏈接。

http://msdn.microsoft.com/en-us/library/hh169179%28v=nav.71%29.aspx

+1

您能否編輯您的解決方案以包含鏈接中的信息? – Lizz

+0

儘管鏈接網站可能有助於解決問題,但最好在此包含網站的主要部分並提供供參考的鏈接。如果鏈接頁面更改,鏈接可能會失效。 – honk

相關問題