ger ger - 7 months ago 91
ASP.NET (C#) Question

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

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.

throw new Exception();

This will generate a HTTP 500