3

I need to test logging of critical errors in an ASP.NET/ASP.NET-Core application.
Now to test this, I need to produce an error that crashes the application for all users.

Something like

FATAL ERROR : Signal Received: SIGSEGV (11)

I can certainly produce a YSOD on a http-request with ease, but how to artificially produce an error that crashes the entire application, that is to say for all users ?

1 Answers1

2

Any stackoverflowing bug should do the trick.
Example:

public class StackOverflower
{
    private string m_MyText;

    public string MyText
    {
        get { return MyText; }
        set { this.m_MyText = value; }
    }
}


class Program
{
    [System.STAThread()]
    static void Main(string[] args)
    {
        var foo = new StackOverflower();
        System.Console.WriteLine(foo.MyText);
    }
}
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442