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 am building a .NET 6 WEB API which I hosted on IIS.
I am hosting the API in base site, not in a subdirectory.
Now, here's what's interesting:
line 68:
IF I set options.RoutePrefix to "routePrefix" variable, I see in logs that options.RoutePrefix is empty in Test environment, BUT when I open the base address, it redirects to index.html and gives me a 404 error.
IF I set options.RoutePrefix to "string.Empty" (ignoring the IF clause in lines 59-62), I see in logs that options.RoutePrefix is empty in Test environment, BUT if I open the base address, it redirects to index.html and shows Swagger UI.
It looks to me as if Swagger ignores the dynamically set "routePrefix"?
The text was updated successfully, but these errors were encountered:
ghost
changed the title
UseSwaggerUI bug when working with different environments
[BUG?] UseSwaggerUI bug when working with different environments
May 10, 2023
Can you create a sample application and zip it or upload it to Github and I can then have a look. Also if you are using .Net8 you can test if DotSwashbuckle resolves your issue
Hello,
I am building a .NET 6 WEB API which I hosted on IIS.
I am hosting the API in base site, not in a subdirectory.
Now, here's what's interesting:
line 68:
IF I set options.RoutePrefix to "routePrefix" variable, I see in logs that options.RoutePrefix is empty in Test environment, BUT when I open the base address, it redirects to index.html and gives me a 404 error.
IF I set options.RoutePrefix to "string.Empty" (ignoring the IF clause in lines 59-62), I see in logs that options.RoutePrefix is empty in Test environment, BUT if I open the base address, it redirects to index.html and shows Swagger UI.
It looks to me as if Swagger ignores the dynamically set "routePrefix"?
The text was updated successfully, but these errors were encountered: