【问题标题】:Seeting the default page of the svc-less WCF service设置 svc-less WCF 服务的默认页面
【发布时间】: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


    【解决方案1】:

    转到属性 -> Web -> 单击特定页面并输入/HelloWorldService.svc

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-10
      • 2017-06-17
      • 1970-01-01
      • 2011-01-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多