【问题标题】:Service Routing Table works in IIS7 but not IIS6?服务路由表在 IIS7 中有效,但在 IIS6 中无效?
【发布时间】:2010-09-14 21:45:44
【问题描述】:

我有一个 WCF 服务,它使用 Global.asax 文件来激活我的服务。所以,我的部署框上部署的虚拟目录看起来像

web.config 全球.asax - 其中包含 Services.dll 和 Services.pdb

Services.dll 是我的 Service.svc 和 Service.svc.cs 文件的编译位。

如何让这个设置在 IIS6 中工作?我的 Global.asax 看起来像:

public class Global : HttpApplication
{
    void Application_Start(object sender, EventArgs e)
    {
        RegisterRoutes();
    }

    private void RegisterRoutes()
    {
        WebServiceHostFactory factory = new WebServiceHostFactory();
        RouteTable.Routes.Add(new ServiceRoute("MyService", factory, typeof(MyService)));
    }
}

有什么想法吗?这适用于 IIS7,因此我可以导航到 http://server/MyService/...

【问题讨论】:

    标签: wcf iis-7 routing .net-4.0 iis-6


    【解决方案1】:

    AFAIK 不幸的是,在 IIS6 中,您需要决定要使用的扩展名,以便您的 url 为 http://server/MyService.extension。然后您需要在 IIS6 中注册该扩展以供 ASP.NET 处理。

    我们使用 .mvc,所以我们的网址看起来像 http://server/MyService.mvc。我们很快就会迁移到 IIS7,所以我们现在只是坚持下去,所以可能会有更好的方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-03
      • 1970-01-01
      • 2011-07-30
      • 1970-01-01
      • 2011-05-12
      • 2020-01-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多