Tuesday, March 24, 2015

Fixing "500 : undefined" error in Swashbuckle/Swagger

Suppose you include XML docs to make your Swagger/Swashbuckle docs even better via the option:

  c.IncludeXmlComments(Path.Combine(HttpRuntime.BinDirectory, "Das Docs.xml"));

And things work great locally. But then you publish to a webserver, an Azure Website, etc. and you get an error like this:

  500 : undefined http://your-site:80/swagger/docs/v1

You probably already enabled the generation of the XML documentation file, but did you do it for the Release configuration? Since you're here, probably not. Fix that and you'll be all set.