运行WCF服务时显示网页 [英] Displaying web page when running WCF service
问题描述
我有一个在数据库上运行的WCF服务。在Visual Studio中运行此项目时,将打开一个浏览器页面,该页面只显示项目的文件结构。
我有一个显示服务用户界面的HTML文件。我怎样才能让这个文件在运行项目时自动显示在浏览器中?在此先感谢!
其他答案可以解决问题。如果您希望显示文件而不必重定向到实际文件,可以执行以下操作。
将此添加到您的WCF服务的web.config中:
p> < system.webServer>
< defaultDocument enabled =true>
<档案>
< clear />
< add value =Index.html/>
< / files>
< / defaultDocument>
< /system.webserver>
运行项目时,Index.html将自动加载。
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!
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.
这篇关于运行WCF服务时显示网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!