This post originated from an RSS feed registered with .NET Buzz
by Anand M.
Original Post: More on Extending My Namespace
Feed Title: .NET From India
Feed URL: http://www.dotnetindia.com/index.rss
Feed Description: Your daily dose of .NET From India
In reply to my previous post on extending My namespace, PaulV had pointed out that My.Computer was really a class and not an namespace.
Joe Binder had further commented on how to extend this using partial classes. The real secret is knowing the exact class name that is used, in this case MyComputer.
I tried out what Joe had suggested and it works ok. Intellisense still seems to have a problem picking up the new stuff that I had added(this maybe due to the fact that I was using the same project to both extend and use the class), but then the compiler had no problems linking stuff up.
But I still think this is not a clean way to do this.
What I would really like is something like a config file in VB 2005, where you say something like
And VB is able to link both of this up. The cool thing about this approach is that in VB, I get to give the developer easy access to this library via the My namespace, while for C#, I just let them use the normal assembly and namespace.