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
When I upgraded to use version 5.0.0 and use SerializeAsV2, I get an error saying "Invalid URI: The format of the URI could not be determined." If I don't use SerializeAsV2, I don't get the error. Unfortunately, I need to use SerializeAsV2. How can I fix this? Also, this only occurs when using IIS, not IISExpress.
Include package: <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
Try to get json from url, will result in the following error
{
"Message": "Internal Server Error.",
"StackTrace": " at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)\r\n at System.Uri..ctor(String uriString)\r\n at Microsoft.OpenApi.Models.OpenApiDocument.WriteHostInfoV2(IOpenApiWriter writer, IList`1 servers)\r\n at Microsoft.OpenApi.Models.OpenApiDocument.SerializeAsV2(IOpenApiWriter writer)\r\n at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.RespondWithSwaggerJson(HttpResponse response, OpenApiDocument swagger)\r\n at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\r\n at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\r\n at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\r\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)",
"ErrorMessage": "Invalid URI: The format of the URI could not be determined.",
}
The text was updated successfully, but these errors were encountered:
When I upgraded to use version 5.0.0 and use SerializeAsV2, I get an error saying "Invalid URI: The format of the URI could not be determined." If I don't use SerializeAsV2, I don't get the error. Unfortunately, I need to use SerializeAsV2. How can I fix this? Also, this only occurs when using IIS, not IISExpress.
Include package:
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
Set swagger to use v2
The text was updated successfully, but these errors were encountered: