How to simulate an HTTP 500 error on my ASP.NET app?

Viewed 42605

I want to simulate this error so I can check a generic error page is displayed, not the HTTP 500 one, in light of the recent security vulnerability.

We include special processing in the site itself for 404 and 403 so I want to make sure that errors without special processing work too.

6 Answers

Change the name of your dll file. It will crash the app if you ask for a route afterwards because it won't find the controller. I used this to test my logging.

Related