In VB you can have this:
Class One
Private myTwo As Two = New Two(Me)
End Class
Class Two
Sub New(withOne As One)
End Sub
End Class
But in C#, you can't do this:
class One
{
private Two myTwo = new Two(this);
}
class Two
{
public Two(One withOne)
{
}
}
Because you get an error "Keyword 'this' is not available in the current context".
I found this question/answer which quotes the C# language specification section 7.6.7:
7.6.7 This access
A this-access is permitted only in the block of an instance constructor, an instance method, or an instance accessor. ... (specifics omitted) ... Use of this in a primary- expression in a context other than the ones listed above is a compile-time error. In
particular, it is not possible to refer to this in a static method, a static property
accessor, or in a variable-initializer of a field declaration.
Furthermore, this question covers it (although, in my option, does not sufficiently answer it), and Oblivious Sage's answer to my question here explains why -- because it's bug-preventing feature.
Why was this feature left out of VB?