Sharif.rifat
Sharif.rifat

Reputation: 91

SwashBuckle UI in .Net Core 2.0 showing error

I have just install Swashbuckle.AspNetCore 5.6.3 and do all the configurations where needed.

when I run the debugger and got the localhost:65183/swagger/index.html from by browser it is showing the following error in console:

Uncaught TypeError: Cannot read property 'forEach' of undefined at window.onload (index.html:51) window.onload @ index.html:51 load (async) (anonymous) @ index.html:46

I have the following folder structure. Here is screenshot of my Project in Visual Studio.

Project Structure

Upvotes: 2

Views: 856

Answers (1)

Sharif.rifat
Sharif.rifat

Reputation: 91

I figured out the problem. I missed a line in the configuration.

This line

app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
            });

Upvotes: 4

Related Questions