Microsoft.VisualBasic

TechnoTone

Junior Contributor
Joined
Jan 20, 2003
Messages
224
Location
UK - London
I've just run across this article which talks about the Microsoft.VisualBasic namespace and its Compatibility namespace. According to this the Microsoft.VisualBasic namespace does contain true .NET functions, only the compatibility library doesn't.

Looks like I'll be restoring the Microsoft.VisualBasic namespace to my project templates.
 
Very interesting - It did state that InputBox is not a true .NET feature what is the .NET equivalent to the InputBox?

How can I set Visual Basic.net to not allow me to use anything that will require the compatability namespace. I.e If i type into the code editor InputBox(whatever) then if it doesn't place a squiggly line underneath it, and intellisense pops up parameter requirements, i will presume it is ok to use it!
 
That's a good point. There doesn't seem to be a seperate Compatilibily namespace, it is part of the VisualBasic namespace.

It looks like that article isn't very accurate. :(
 
There is a separate compatibility namespace, the DLL for which is only referenced if you've used the upgrade wizard however.

Using types in Microsoft.VisualBasic is not necessarily bad practice, but the types in there are not true .NET classes, in most senses of the word. They are only there as helpers for Visual Basic. There's nothing wrong with using them.

On the other hand, a common viewpoint (including mine) is that it's bad practice to use them, because when you inevitably have to write something in C#, or even read something, or convert something - you're going to be disadvantaged for having relied on those helpers in the past.

They can be very helpful for people struggling to make the transition from VB6 to .NET, but in my opinion the time comes when you don't need them to hold your hand any more, and you can use the pure framework like other .NET languages do.
 
Back
Top