Sungam Yang
Sungam Yang

Reputation: 615

Seeting the default page of the svc-less WCF service

I made a 'Hello World' WCF service. The service doesn't have a svc file. Therefore the web.config file determines its address and other settings.

However, I'm stuck with opening the specific page. When I run the WCF service project, it always shows the error page (HTTP Error 403.14). This is because the browser tries to go to localhost instead of localhost/HelloWorldService.svc.

Do you know how can I solve it?

I want to open the localhost/HelloWorldService.svc when I start running the WCF service in VS 2012.

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

Upvotes: 2

Views: 838

Answers (1)

zimdanen
zimdanen

Reputation: 5626

Go to Properties -> Web -> click Specific Page and enter /HelloWorldService.svc.

Upvotes: 2

Related Questions