I followed the instruction and added two files as "Embedded Resources" in my Swagger folder:
APIDemo
|
|------ Swagger
|
|----index.html
|----style.css
My SwaggerConfig.cs:
.EnableSwaggerUi(c =>
{
c.InjectStylesheet(thisAssembly, "APIDemo.Swagger.style.css");
c.CustomAsset("index", thisAssembly, "APIDemo.Swagger.index.html");
But I got the following error messages when I run the project:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:53670/swagger/ui/lib/underscore-min-js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:53670/swagger/ui/lib/handlebars-2-0-0-js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:53670/swagger/ui/lib/underscore-min-js
Failed to load resource: the server responded with a status of 404 (Not Found) backbone-min-js:3 Uncaught TypeError: Cannot read property 'each' of undefined swagger-ui-js:9
Uncaught ReferenceError: Handlebars is not defined http://localhost:53670/swagger/ui/lib/highlight-7-3-pack-js Failed to load resource: the server responded with a status of 404 (Not Found) index:54
Uncaught ReferenceError: SwaggerUi is not defined
What could be the reason? Thanks.