services.AddSwaggerGen() giving error

后端 未结 4 425
情书的邮戳
情书的邮戳 2021-01-01 10:06

All I\'m trying to do is add swagger to an ASP.Net Core application. I\'m watching a tutorial and all I see them do is add services.AddSwaggerGen(); under the c

4条回答
  •  猫巷女王i
    2021-01-01 10:46

    I had problem, that

    IServiceCollection does not contain a definition for 'AddSwaggerGen'

    I turnes out, that I installed Swashbuckle.AspNetCore.Swagger nuget package instead of Swashbuckle.AspNetCore.

    In .NET Core 3, there's some issues as discussed here. The solution is to add the following to the project file, replacing the prior version.

    
    
    

提交回复
热议问题