servicestack,Routing,servicestack" /> servicestack,Routing,servicestack" />

Routing Servicestack cool uri';部署时无法解析

Routing Servicestack cool uri';部署时无法解析,routing,servicestack,Routing,servicestack,我们正在成功地开发酷uri(SS v3.9.64,Visual Studio 2012,Framework 3.5),例如: Routes.Add<Bark>("/bark.ashx/{dogname}", "GET"); 我们通过将项目发布到本地并从VisualStudio2012运行它(它应该是同一台服务器)来重现这个问题 我们使用.ashx扩展是为了能够在W2003/IIS6中工作,正如在几个地方所解释的那样。IIS 6所需的.ashx扩展应该是处理器路径的一部分,而不是路径

我们正在成功地开发酷uri(SS v3.9.64,Visual Studio 2012,Framework 3.5),例如:

Routes.Add<Bark>("/bark.ashx/{dogname}", "GET");
我们通过将项目发布到本地并从VisualStudio2012运行它(它应该是同一台服务器)来重现这个问题


我们使用.ashx扩展是为了能够在W2003/IIS6中工作,正如在几个地方所解释的那样。

IIS 6所需的
.ashx
扩展应该是处理器路径的一部分,而不是路径,例如:

  <!-- ServiceStack: Required to host at: /api.ashx -->
  <location path="api.ashx">
    <system.web>
      <httpHandlers>
        <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
      </httpHandlers>
    </system.web>

    <!-- Required for IIS7 -->
    <system.webServer>
      <modules runAllManagedModulesForAllRequests="true"/>
      <validation validateIntegratedModeConfiguration="false" />
      <handlers>
        <add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
      </handlers>
    </system.webServer>
  </location>
  <!-- Required for MONO -->
  <system.web>
    <httpHandlers>
      <add path="api.ashx*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
    </httpHandlers>
  </system.web>
  <!-- Required for IIS7 -->
  <system.webServer>
    <!-- ServiceStack: Required -->
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>

那么您的路线注册将是:

Routes.Add<Bark>("/bark/{dogname}", "GET");
添加(“/bark/{dogname}”,“GET”);
Routes.Add<Bark>("/bark/{dogname}", "GET");