在使用WCF+IIS的时候碰到的一个很诡异的问题。
操作系统:windows 2008
在访问.svc文件时,发生如下错误:
错误:HTTP Error 404.17 – Not Found, The requested content appears to be script and will not be served by the static file handler
不少人碰到这种问题,解决方案各不一样。
从这个错误报告看,似乎是系统无法解析svc文件,可是这个iis已经安装了所有必要的组件。
这片文章提供了一个解决方案:
原因:可能是iis使用的isapi版本太高,是4.0的,而所开发的系统用的可能是2.0的。重新注册2.0的isapi即可。
即运行如下命令
1. cmd
2. cd C:\Windows\Microsoft.NET\Framework64\v3.0\Windows Communication Foundation
3. ServiceModelReg.exe -i