2013-05-07 19 views
1

我發了一個'Hello World'WCF服務。該服務沒有svc文件。 因此web.config文件決定了它的地址和其他設置。發送svc-less WCF服務的默認頁面

但是,我堅持打開特定頁面。 當我運行WCF服務項目時,它始終顯示錯誤頁面(HTTP錯誤403.14)。 這是因爲瀏覽器試圖去本地主機而不是localhost/HelloWorldService.svc

你知道我該怎麼解決它?

我想打開本地主機/ HelloWorldService.svc當我開始在2012年VS運行WCF服務

<?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> 

回答

1

進入屬性 - >網絡 - >點擊特定網頁,並輸入/HelloWorldService.svc

+0

爲我工作。 – 2013-12-19 18:00:20