While it's not completely clear from the code that you posted, I'm pretty certain that your issue is because of the following mistake:
class StackoverflowExample
{
public string SomeProperty
{
get { return SomeProperty; }
set { SomeProperty = value; }
}
}
A properly implemented non-automatic property has to have a "backing field":
class PropertyWithBackingFieldExample
{
private string SomePropertyBackingField;
public string SomeProperty
{
get { return SomePropertyBackingField; }
set { SomePropertyBackingField = value; }
}
}
Automatic properties actually are exactly the same - just not visible in the source code, because the compiler will implement the backing field for you
automatically.