【发布时间】:2013-05-08 02:28:43
【问题描述】:
我创建了一个“Hello World”WCF 服务。该服务没有 svc 文件。 因此,web.config 文件决定了它的地址和其他设置。
但是,我无法打开特定页面。 当我运行 WCF 服务项目时,它总是显示错误页面(HTTP 错误 403.14)。 这是因为浏览器尝试访问 localhost 而不是 localhost/HelloWorldService.svc。
你知道我该如何解决吗?
我想在 VS 2012 开始运行 WCF 服务时打开 localhost/HelloWorldService.svc。
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
<a href="http://go.microsoft.com/fwlink/?LinkId=169433">http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment >
<serviceActivations>
<add factory="System.ServiceModel.Activation.ServiceHostFactory"
relativeAddress="HelloWorldService.svc"
service="HelloWorldService.HelloWorldService"/>
</serviceActivations>
</serviceHostingEnvironment>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
【问题讨论】:
标签: wcf