是什么导致显示WCF错误404.17? [英] What causes WCF Error 404.17 to be shown?

查看:116
本文介绍了是什么导致显示WCF错误404.17?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到此错误:

404.17-请求的内容似乎是脚本,并且不会由静态文件处理程序提供服务

404.17 - The requested content appears to be script and will not be served by the static file handler

我正在Windows 8,VS2013上运行IIS 8.5.我的应用程序池设置为.NET 4(我认为从.Net 2到.Net 4的迁移是造成此问题的原因).我的服务代码是.NET 3.5.

I'm running IIS 8.5 on Windows 8, VS2013. My App pool is set to .NET 4 (I believe the move from .Net 2 to .Net 4 is what caused the problem). My service code is .NET 3.5.

我检查了.NET 3.5和4.5是否都作为功能启用,以及ISAPI扩展和筛选器的可扩展性. 我试过了:

I checked that .NET 3.5 and 4.5 are both enabled as features, along with Extensibility for both, ISAPI extensions and filters. I tried:

  • 卸载并重新安装ASP.NET 4.5
  • 运行ServiceModelReg(如建议然后,我终于通过启用"HTTP激活"(如建议的这里).

    I then finally fixed it by enabling "HTTP Activation" (as suggested here).

    我的问题是:此错误实际上是什么意思?我基本上是通过盲目搜索网络并尝试各种建议来解决此问题的,但是对我来说,如果我确切地理解了这个错误告诉我的内容,我也许可以更快地做到这一点.

    My question is this: what does this error actually mean? I've basically fixed it by blindly searching the net and trying various suggestions, but it occurs to me that I might have been able to do this quicker if I understood exactly what this error was telling me.

    在对这篇文章进行了有益和建设性的评论之后,我想我将尽力澄清我在这里要问的问题.

    After the helpful and constructive comments made on this post, I think I'll try to clarify exactly what I'm asking here.

    很显然,错误消息本身(在某种程度上)确实是有意义的. static处理程序将无法运行script.那么,这是HTTP激活功能吗?为什么ServiceModelReg有帮助?从.Net2迁移到.Net4时,为什么会出现此问题?

    Obviously, the error message in and of itself does make sense (to an extent). A static handler would be unable to run a script. So, is that what HTTP Activation does? Why would ServiceModelReg help? Why would this problem appear when moving from .Net2 to .Net4?

    推荐答案

    错误消息告诉您:

    静态文件处理程序将提供您的源代码 服务器端脚本,而不是另一个执行该脚本的处理程序.那 可能不是您想要发生的事情,所以我抛出了异常 代替.

    The static file handler is about to serve the source code of your server-side script instead of another handler executing it. That probably is not what you want to happen, so I'm throwing an exception instead.

    此错误表明您的处理程序设置不正确.在您的情况下,对服务的请求应该由Http激活服务(我猜是一个IHttpModule)接收,但是因为它没有(模块未处于活动状态),所以最终由静态对象处理.文件处理程序作为最终的备用.

    This error is an indication of your handlers not being set up right. In your case the request to your service was supposed to be picked up by the Http Activation Service (I'm guessing an IHttpModule), but because it wasn't (the module was not active), it ended up being handled by the static file handler as a final fallback.

    ServiceModelReg安装或重新安装适当的WCF组件.显然,如果您完全没有设置WCF,则可能可以解决此问题.

    ServiceModelReg installs or re-installs the proper WCF components. Obviously that might work to fix this problem if you don't have WCF set up altogether.

    Http激活模块(System.ServiceModel.Activation.HttpModule)已注册在machine.config文件中. .NET 2.0和.NET 4.0具有单独的machine.configs.这两个.NET版本还分别具有Http激活功能.

    The Http Activation Module (System.ServiceModel.Activation.HttpModule) is registered in the machine.config file. .NET 2.0 and .NET 4.0 have separate machine.configs. The Http Activation feature also exists for both .NET versions separately.

    这篇关于是什么导致显示WCF错误404.17?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆