How it works...

Press Ctrl + F5 again to restart IIS Express and launch our application. You will see that our custom error page has been displayed inside the browser:

In reality, we will probably use a controller to do this kind of thing. What I wanted to illustrate here was the use of adding a custom default page and to display that page when an exception happens in the production environment.
As you can see, middleware in ASP.NET Core is really useful. There is a lot of documentation regarding his topic, and I encourage you to do some further reading on the topic. Start with the Microsoft documentation at https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.187.62