+21  A: 

It's because you're recursively calling the property - in the set you are setting the property again, which continues ad infinitum until you blow the stack.

You need a private backing field to hold the value, e.g.

private string firstName;

public string FirstName;
{
    get
    {
        return this.firstName;
    }
    set
    {
        this.firstName = value
    }
}

Alternatively, if you're using C# 3.0, you could use an auto-property, which creates a hidden backing field for you, e.g.

public string FirstName { get; set; }
Greg Beech
+6  A: 

You are setting the property name inside your property--not the field name. This would work better:

private m_firstName;

public String firstName;
{
    get
    {
        return m_firstName;
    }
    set
    {
        m_firstName = value;
    }
}
Michael Haren
I've made this error myself...
Michael Haren
It's even more fun when you find one in a third party's library code...
Andrew Kennan
A: 

Thanks Guys!

Adam Lerman