1

有很多问题可以回答这个问题,但没有一个答案对我有用。

PUT最初,当我尝试或DELETE (可能还有其他动词)时,我得到了 405 。查看一些问题,解决方案似乎是更改处理程序映射。

我更改了以下内容:

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

我注意到动词已经在One of the following verbs盒子里了,所以我绝望地把它改成了接受所有动词。

现在,我什至无法加载网页,更不用说像 a 那样发出任何异国情调的请求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. 替换ServiceModel中的applicationHost.config

    <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" />

我还能做什么,或者我应该在哪里寻找?

谢谢

戴夫

4

5 回答 5

5

您还必须使用 dism /online /enable-Feature /all /FeatureName:WCF-HTTP-Activation45 激活 servicemodel 4.0

并在 de IIS 管理器(服务器-> 功能-> 模块)中检查您是否看到 servicemodel 4.0,然后删除 servicemodel。

于 2014-04-04T10:21:57.333 回答
3

在我的计算机上安装 Synfusion Essential Studio 后,我遇到了同样的问题。我通过执行以下步骤解决了:

  1. 打开 IIS 管理器控制台
  2. 在服务器面板上转到模块,功能视图
  3. 确保 ServiceModule-4.0 在那里。如果不存在,请执行上述步骤 (1-6)
  4. 删除 ServiceModel 模块
于 2014-10-25T18:08:33.930 回答
1

只是认为这可能会对某人有所帮助。

如果运行 IIS 的计算机上有多个 .NET Framework 版本,并且 IIS 是在 .NET Framework 4.0 之后或在 Windows Communication Foundation 中注册服务模型之前安装的,则可能会发生此错误。

这是解决此问题的链接。

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

于 2014-11-21T17:40:41.803 回答
0

Adding this to my application's web.config worked for me:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
        <add name="ServiceModel-4.0" type="System.ServiceModel.Activation.ServiceHttpModule, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
    </modules>
</system.webServer>
于 2020-12-22T14:22:25.040 回答
0

这个链接对我有用。

http://www.codeproject.com/Articles/613812/Solve-IIS-Error-Could-not-load-type-System-Servi

您必须删除 ServerModel 模块和 svc 集成处理程序。

于 2015-12-28T13:43:42.047 回答