2012-11-19 12 views
6

Aşağıdaki yapılandırmam var. Başka <system.webServer /> bölüm eklersenizServiceStack neden bu yapılandırma ile 404'ü döndürüyor?

<location path="services"> 
    <system.web> 
    <httpHandlers> 
     <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" /> 
    </httpHandlers> 
    <authorization> 
     <allow users="*"/> 
    </authorization> 
    </system.web> 
    <!-- Required for IIS 7.0 --> 
    <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> 

değil, bir location öğesi içinde, ServiceStack tüm istekler için 404 döndürür. Çıkar ve her şey tekrar işe yarıyor.

 
HTTP/1.1 404 Not Found 
Cache-Control: private 
Content-Type: text/plain; charset=utf-8 
Server: Microsoft-IIS/7.5 
X-Powered-By: ServiceStack/3.926 Win32NT/.NET 
X-AspNet-Version: 4.0.30319 
X-Powered-By: ASP.NET 
Date: Mon, 19 Nov 2012 23:15:46 GMT 
Content-Length: 1528 

Handler for Request not found: 


Request.ApplicationPath: /MyWebApp.Web.UI 
Request.CurrentExecutionFilePath: /MyWebApp.Web.UI/services/echo/ 
Request.FilePath: /MyWebApp.Web.UI/services/echo/ 
Request.HttpMethod: GET 
Request.MapPath('~'): D:\Lib\MyWebApp\2013\MyWebApp\MyWebApp.Web.UI 
Request.Path: /MyWebApp.Web.UI/services/echo/ 
Request.PathInfo: 
Request.ResolvedPathInfo: /services/echo 
Request.PhysicalPath: D:\Lib\MyWebApp\2013\MyWebApp\MyWebApp.Web.UI\services\echo\ 
Request.PhysicalApplicationPath: D:\Lib\MyWebApp\2013\MyWebApp\MyWebApp.Web.UI\ 
Request.QueryString: 
Request.RawUrl: /MyWebApp.Web.UI/services/echo/ 
Request.Url.AbsoluteUri: http://localhost/MyWebApp.Web.UI/services/echo/ 
Request.Url.AbsolutePath: /MyWebApp.Web.UI/services/echo/ 
Request.Url.Fragment: 
Request.Url.Host: localhost 
Request.Url.LocalPath: /MyWebApp.Web.UI/services/echo/ 
Request.Url.Port: 80 
Request.Url.Query: 
Request.Url.Scheme: http 
Request.Url.Segments: System.String[] 
App.IsIntegratedPipeline: True 
App.WebHostPhysicalPath: D:\Lib\MyWebApp\2013\MyWebApp\MyWebApp.Web.UI 
App.WebHostRootFileNames: [global.asax,global.asax.cs,header.html,list.html,login.html,MyWebApp.web.ui.csproj,MyWebApp.web.ui.csproj.user,packages.config,web.config,bin,humanresources,js,obj,properties,styles,_sgbak] 
App.DefaultHandler: DefaultHttpHandler 
App.DebugLastHandlerArgs: GET|/MyWebApp.Web.UI/services/echo/|D:\Lib\MyWebApp\2013\MyWebApp\MyWebApp.Web.UI\services\echo\ 

başka system.webServer bölüm olması mümkün değil midir:

İşte bir örnek tepkidir? Orada IIS URL yeniden yazma kuralları eklemek istiyorum.

cevap

4

Ek system.webServer bildirimi, ServiceStack'ın barındırılan yolun Web.Config öğesinden otomatik olarak çıkarılmasını engelliyor olabilir.

O senin AppHost.Configure içinde, örneğin yardımcı olur() görmek için yolu elle ayarlamak için deneyebilirsiniz: belirir

SetConfig(new HostConfig { 
    HandlerFactoryPath = "services", 
}); 
+0

bunu olmaktır. Düzeltme için teşekkürler (ve harika bir kütüphane). – Daniel

+0

thx :) kool, işe yaradı. – mythz

+0

Teşekkürler, Ria hizmetlerini kullanarak Silverlight'ta da aynı sorun vardı. – epitka

İlgili konular