Can someone explain to me why in the following the 3rd invocation of DoSomething is invalid? ( Error message is \"The name \'DoSomething\' does not exist in the current cont
Because DoSomething
takes a parameter.
DoSomething(a)
would be legal.
Edit
I read the question a bit wrong here.
Since your calling it a a normal static method, and not a extension method, you need to prefic with the class name.
So A_Ext.DoSomething(a);
will work.
If you call it like a normal static method, all the same rules apply.
Your second variant works because B inhetits A, and therefore you still end up calling it as an extension method, but the third does not.
sorry about the first version above that does not work. I'll leave it to keep the comment relevant.