user2100791
user2100791

Reputation:

Displaying web page when running WCF service

I have a WCF service that operates on a database. When running this project in Visual Studio, a browser page opens that simply shows the project's file structure.

I have an HTML file that displays a user interface for the service. How can I make it so that this file is automatically displayed in the browser when running the project? Thanks in advance!

Upvotes: 0

Views: 881

Answers (3)

user2100791
user2100791

Reputation:

The other answers will do the trick. If you want your file to be displayed without having to redirect to the actual file, you can do the following.

Add this to your WCF service's web.config:

<system.webServer>
<defaultDocument enabled="true">
  <files>
    <clear />
    <add value="Index.html" />
  </files>
</defaultDocument>
</system.webserver>

Index.html will now be automatically loaded when running the project.

Upvotes: 1

Andy
Andy

Reputation: 3743

In Project Properties -> Web -> StartAction -> select "Specific Page" and specify the page you want to be displayed instead of the default service view

Upvotes: 0

arjun
arjun

Reputation: 11

Right click on the HTML file on the project explorer and select "Set as Start Page".It will display this while running the project.

Upvotes: 1

Related Questions