You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the necessary pages setup using the following route.
RouteTable.Routes.Add(new ServiceRoute("swagger/ui", new WebServiceHostFactory(), typeof(SwaggerWcfEndpoint)));
When I run the site locally in Visual Studio, I can access both the following URLs without any issue.
/swagger/ui (which correctly redirects to /swagger/ui/index.html?url=/swagger/ui/swagger.json)
/swagger/ui/swagger.json
However, when I publish the site to an IIS server, then immediately after the release the above pages work, but then sometime within a span of 12 hours (overnight) the swagger.json file loses all of its details. What I mean loses details is that it starts full of the info, operations, tags, everything as expected:
{"swagger":"2.0","info":{"title":"Test Web Service","description":"Description of the web service"}, ...etc...
Then later on (haven't narrowed down the exact timing other than it happens overnight) the swagger.json file becomes simply:
{"swagger":"2.0"}
I'm at a loss to figure out why, any help would be appreciated.
The text was updated successfully, but these errors were encountered:
Discovered my issue is similar (same underlying problem, but different scenario) to issue #126
I have a separate assembly for my host and service, so that my web service code is agnostic of hosting platform. No dynamically loaded assemblies, just separation of concerns using what I believe to be best practices of WCF web service design.
Because IIS is smart enough to only load assemblies it requires on demand, the service assembly is not immediately loaded after a application pool recycle or restart. And since all my attributes are in the service assembly, it's not loaded in AppDomain.CurrentDomain when SwaggerWcf initializes.
My workaround at the moment is to load the assembly of the decorated service class in Application_Start with the following line of code:
I have the necessary pages setup using the following route.
RouteTable.Routes.Add(new ServiceRoute("swagger/ui", new WebServiceHostFactory(), typeof(SwaggerWcfEndpoint)));
When I run the site locally in Visual Studio, I can access both the following URLs without any issue.
/swagger/ui (which correctly redirects to /swagger/ui/index.html?url=/swagger/ui/swagger.json)
/swagger/ui/swagger.json
However, when I publish the site to an IIS server, then immediately after the release the above pages work, but then sometime within a span of 12 hours (overnight) the swagger.json file loses all of its details. What I mean loses details is that it starts full of the info, operations, tags, everything as expected:
{"swagger":"2.0","info":{"title":"Test Web Service","description":"Description of the web service"}, ...etc...
Then later on (haven't narrowed down the exact timing other than it happens overnight) the swagger.json file becomes simply:
{"swagger":"2.0"}
I'm at a loss to figure out why, any help would be appreciated.
The text was updated successfully, but these errors were encountered: