【问题标题】:How to set default page in WCF when its start with windows service使用 Windows 服务启动时如何在 WCF 中设置默认页面
【发布时间】:2014-09-26 12:03:58
【问题描述】:

我有一个带有 Windows 服务的 WCF 服务。当我安装该服务时,我访问了 Web 服务,但页面“Default.aspx”不显示。

我用这个来配置 web.config:

<system.webServer>
    <defaultDocument enabled="true">
        <!-- this line enables default documents for a directory -->
        <files>
            <clear />
            <!-- removes the existing default document list -->
            <add value="Default.aspx"></add>
        </files>
    </defaultDocument>
    <modules runAllManagedModulesForAllRequests="true" />
</system.webServer>

但不起作用。

我尝试在“属性 -> 网络 -> 单击特定页面”中但也不起作用。

如何解决?

提前致谢!

【问题讨论】:

    标签: c# asp.net wcf windows-services


    【解决方案1】:

    听起来您希望能够提供不同于处理 WCF 请求的 ASPX 页面。

    查看此主题以进行类似讨论:

    Can a self-hosted WCF app host ASP.NET pages/handle POST without IIS?

    【讨论】:

      猜你喜欢
      • 2012-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-21
      • 1970-01-01
      • 2014-03-18
      • 2014-12-06
      • 2010-12-27
      相关资源
      最近更新 更多