Search code examples
.net-coreswaggernswag

swagger error for my upgraded .netcore app


So I do have this web api built in .netcore 2.2 when Im on the process of upgrading this error shows up

System.InvalidOperationException: 'API Explorer not registered in DI.'

I already upgraded my swagger nugget and follow some instructions in upgrading but this error still pops up.

Click for the image of the error


Solution

  • Add services.AddMvcCore().AddApiExplorer();

    in public void ConfigureServices(IServiceCollection services)