New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swagger .NETCORE can't read json #416
Comments
what does VirtualDirectory return? |
Returns "/api" |
If you want to customize the URL it has to be done in two middlewares like below.
|
I've changed and got "Additional information: Unable to resolve service for type 'Swashbuckle.AspNetCore.Swagger.ISwaggerProvider' while attempting to activate 'Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware'." |
Sorry i gave an answer related to the Swashbuckle.AspNetCore but looks like you are not using that. |
I'm using Swashbuckle.AspNetCore. |
I realized the error occurs in Program.cs
|
Try this This should work. |
Throws the same exception: Unable to resolve service for type 'Swashbuckle.AspNetCore.Swagger.ISwaggerProvider' while attempting to activate 'Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware'. |
@leilasoriano Looking at your For example, I see you've got the correct latest Have you tried removing all Swashbuckle package references except for the Note it also looks like you haven't actually moved to the final .NET Core build/app tooling, which could affect your ability to reach success. .NET Core and the dotnet CLI moved away from project.json at release time. |
The README on this repo also has a relevant note:
|
Did it got fixed for you. I am also facing similar issue |
For anyone experiencing this issue, please ensure you have the latest version of Swashbuckle.AspNetCore - v2.5.0 at the time of writing. If you've pulled that down and still experience this issue, let me know and I'll re-open the ticket. |
I'm having a trouble with swagger in .netcore. I've tried everything and nothing. I saw another similar questions, but nothing works for me. Running my webapi app with swagger, always returns "Can't read swagger JSON from http://localhost:5000/api/swagger/v1/swagger.json".
My codes:
Project.json
Please, help me.Thanks in advance.
The text was updated successfully, but these errors were encountered: