Swagger not working on its own ServiceStack Service

Following the code example at this url:

https://github.com/ServiceStack/ServiceStack/wiki/Self-hosting

I created an empty solution, pasted the above C # code into 'program.cs' and executed the following nuget commands to import the necessary libraries and code files:

Install-Package ServiceStack
Install-Package ServiceStack.api.Swagger

The service works fine, swagger metadata is delivered correctly, but when I try to visit, /swagger-ui/index.htmlI get an error "Handler not found" .

I shared my basic code example using Dropbox:

ServiceStackSelfhosted.zip (2.5 MB)

ServiceStackSelfhosted_stripped.zip (8 Kb, but for executing nuget commands)

+4
2

Self-Hosting /bin/ .

Copy if Newer ( ) , ServiceStack.

+2

SwaggerFeature, RazorFeature.

RazorFeature Swagger.

public override void Configure(Container container)
{
    //...
   Plugins.Add(new RazorFormat());
   Plugins.Add(new SwaggerFeature());
   //...
}
+2

All Articles