在 Windows Server 2008(64位)上浏览 wcf 服务时,“ HTTP 错误404.3-未找到”

我正在开发一个基于.Net Framework 3.5 sp1并托管在 Windows Server 2008(64位)上的应用程序。

浏览 wcf 服务时(。Svc)本地一切正常,但当浏览完整的域名 URL 时,它得到了一个错误。

本地地址是这样的: 翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳 http://localhost/myservice.svc

域地址是这样的: 翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳 http://mysite.ir/myservice.svc

通过页面(. aspx)和其他文件在本地主机和域地址上正确工作的方式。

任何想法都不胜感激

下面是详细的错误:


HTTP 错误404.3-未找到

由于扩展配置的原因,无法为您请求的页面提供服务。如果页是脚本,则添加处理程序。如果文件应该被下载,添加一个 MIME 映射。 详细错误信息

单元: StaticFileModule

通知: ExecuteRequestHandler

操作员: 静态文件

错误代码: 0x80070032

请求的网址: 翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳翻译: 奇芳 http://mysite.ir:80/myservice.svc

物理路径: D: inetpub vhosts MySite.ir httpdocs MyService.svc

登录方法: 匿名的

登入用户 匿名的

95481 次浏览

OK, here is the answer:

Go to Handler Mappings | Add Handler Manager --> And then add below information

Request Path: *.svc

Type: System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Name: svc-Integrated

If you're using .Net 4.x, the PublicKeyToken is 31bf3856ad364e35.

However, following this post about installing WCF Services properly in IIS, the handler was set up for me.

If anyone has this issue on Windows Server 2012, Bill Moon's answer here solved it for me:

"For Windows Server 2012... From the Server Manager, click on Add roles and features, select the appropriate server, then select Features. Under .NET Framework 4.5 Features, you'll see WCF Services, and under that, you'll find HTTP Activation."

Please make sure you've activated WCF components from here.

Or alternate and easy way is, go to control panel -> Turn Windows feature on or off -> and make sure you've all the options ticked as mentioned in below screenshot.

enter image description here

You might need to activate each box and accept in case you get errors when activating all features at once

I wanted to add this as a comment to the answer but didn't have enough rep for it. I tried running ServiceModelReg and aspnet_regiis.exe with various flags and added HTTP Activation feature but it still didn't work. Even using the Handler mapping UI in IIS didn't work since it could not find System.ServiceModel.Activation.HttpHandler. What finally worked was adding the handler Mori mentions manually to my web.config file.

<system.webServer>
<handlers>
<add name="svc-Integrated" path="*.svc" verb="GET,HEAD,POST,DEBUG" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="integratedMode" responseBufferLimit="4194304" />

My project was running .Net 3.5 and IIS 7.5 on Windows 7 and IIS 7.0 on Win Server 2008 R2.

Try unchecking WCF HTTP activations from "Turn Windows featured on or off" window (See here) and re-install by going to

%windir%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\

and execute ServiceModelReg -i

I have windows 10 in my laptop and using visual studio 2015 for WCF development. WCF is running fine in visual studio but when hosted in IIS I got the same error.

I checked IIS handler. svc extension was missing. So I tried to add new handler in IIS as suggested by Mori in first answer. I didn't find type "System.ServiceModel.Activation.HttpHandler".

So I opened "Turn windows features On or Off" and installed features as highlighted in screen shot.

This worked for me.

enter image description here