Quickest way to generate OutOfMemory exception

One of the quickest way (I am sure there are many) to reproduce an OutOfMem exception in .NET:

1> Drag a textbox on WPF window

2> In XAML, set TextChanged event on the added text box

3> In the TextChanged event, write a line which sets a text on the same textbox which generates this event
for .e.g txtCheckException.Text = “something”;

4> Run the application and enter a keystroke in the textbox.


The event would raised again and again, and very soon (well seconds) you will get the OutOfMemory exception.


Popular posts from this blog

Wix: How to hide the License Agreement dialog in Mondo UI

WPF: TreeView example (Part 4)