ServiceStack works, but Swagger-UI is not

I followed the ServiceStack tutorials (3.9.37) and created a blank ASP.Net web application and your webservice is running as expected:

http://www.somedomain.com:53032/api/metadata

I also linked in the Swagger-UI package (3.9.35)

I added Plugins.Add (new SwaggerFeature ()); in AppHost.Configure

My problem is Swagger-UI is not available as I expected here:

http://www.somedomain.com:53032/swagger-ui/index.html

I am getting a "Request handler not found:" error with a stack trace.

I tried target frame 4.0 and 4.5 with the same result. Visual Studio version - 2012

Anything I missed to set this link correctly?

+3


source to share


1 answer


It turned out to be a path problem. Allowed by the following changes to web.config:



//Added Location node
//path moved here
<location path="api">  // Path moved to location area !!!

<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime/>
<httpHandlers>

//Path returned to wildcard
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>

</httpHandlers>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<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>

      

+3


source







All Articles