StackOverflowException and properties

An easy way to get this exception is by refering a property to itself:

  1. public string myproperty {
  2.     set { myproperty = value; }
  3. }

The exception looks like this:
[StackOverflowException: Exception of type System.StackOverflowException was thrown.]

Granted it’s a pretty dumb thing to do.. :)

Posted on 18 Oct 04 by Helen Emerson (last updated on 18 Oct 04).
Filed under ASP.NET