Does this smell?
I have a few properties you can only set once. They can be set at any time during the objects existence and can not be undone.
I implement then like
Just make the setters methods and not properties - and the disconnect between expectation and behavior goes away. The method is free to throw an InvalidOperationException - but it's unexpected to have a property setter do it.
private FooThingy _foo;
public FooThingy Foo
{
get { return _foo; }
}
public void SetFooThingy(FooThingy value) {
if (Foo != null)
throw new InvalidOperationException("Foo is already set!");
_foo = value;
}