Skip to content
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 Issues #32574

Closed
RaulSamada opened this issue May 14, 2024 · 3 comments
Closed

Swagger Issues #32574

RaulSamada opened this issue May 14, 2024 · 3 comments

Comments

@RaulSamada
Copy link

Description

After install Swashbuckle.AspNetCore and even if I remove the steps for use the Swagger UI in my backend, my asp.net 8 project doesn´t run. I got:
System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Swashbuckle.AspNetCore.Swagger.ISwaggerProvider Lifetime: Transient ImplementationType: Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator': No constructor for type 'Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator' can be instantiated using services from the service container and default values.) (Error while validating the service descriptor 'ServiceType: Swashbuckle.AspNetCore.Swagger.IAsyncSwaggerProvider Lifetime: Transient ImplementationType: Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator': No constructor for type 'Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator' can be instantiated using services from the service container and default values.) (Error while validating the service descriptor 'ServiceType: Microsoft.Extensions.ApiDescriptions.IDocumentProvider Lifetime: Singleton ImplementationType: Microsoft.Extensions.ApiDescriptions.DocumentProvider': No constructor for type 'Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator' can be instantiated using services from the service container and default values.)'
InvalidOperationException: No constructor for type 'Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator' can be instantiated using services from the service container and default values.

Page URL

https://learn.microsoft.com/es-es/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-8.0&tabs=visual-studio

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/tutorials/getting-started-with-swashbuckle.md

Document ID

59222460-a971-e76e-4fe9-23d4d7d768ee

Article author

@zuckerthoben

@guardrex
Copy link
Collaborator

Hello @RaulSamada ... See the note at the start of the article. Swashbuckle isn't supported in .NET 8 or later. For an alternative, see ASP.NET Core web API documentation with Swagger / OpenAPI.

@guardrex
Copy link
Collaborator

However, @RaulSamada, see ...

#32576

... because it looks like support is returning. If you make the changes shown by the PR, hopefully the errors will clear.

@martincostello
Copy link
Member

If they don't, please log an issue here and we can fix it 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants