Comment from MS on Microsoft.VisualBasic usage?

S

Steve

Having only recently migrated across from VB6 to VB.NET I'm still
unsure whether or not I should be making (heavy) use of the
Microsoft.VisualBasic namespace in new applications. I've read a lot
of posts in the (VB).Net newsgroups and seen just about all of the For
and Against arguments i.e. not using it = not coding in VB.NET, not
using it = good OO. I'm also aware of the difference between this
namespace and the compatibility namespace.

Has there been any official comment or guidelines posted by MS on
whether or not it is good or bad practise to use this namespace?

I did find one comment in a chat transcript from Stephen Weatherford
of the Visual Basic development team:

----------

http://msdn.microsoft.com/chats/vstudio/vstudio_060303.asp

Q: Re: the question, "There are two VB namespaces, right?
Compatibility and regular VB?"

A: Let me add to this... There *are* two
namespaces--Microsoft.VisualBasic and
Microsoft.VisualBasic.Compatibility.
Microsoft.VisualBasic.Compatibility is only used when you upgrade a
VB6 application, and is for backwards compatibility purposes (it is a
separate DLL from Microsoft.VisualBasic.dll). The
Microsoft.VisualBasic namespace, however, provides the runtime
functions for Visual Basic. As Cameron pointed out, you always get
this reference for free (it is different from the VB compatibility
runtime). It is *not* for backwards compatibility, but rather for
current Visual Basic .NET programs.

----------

This leads me to believe that there is no issue with me contuining to
use the VB functions I am familiar with.

Does anyone else have links to any other comments or postings by MS?
Or hopefully there is someone from MS monitoring this newsgroup that
can put my mind at rest once and for all.
 
J

Jan Tielens

I think this is what you are looking for:
http://msdn.microsoft.com/library/d...tml/vbtchmicrosoftvisualbasicnetinternals.asp

Quote:
The Visual Basic 6.0 Compatibility library is distinct from the Visual Basic
Runtime. The Microsoft.VisualBasic.Compatibility namespace is used by the
tools that upgrade Visual Basic 6.0 code to Visual Basic .NET. It is a
bridge to support Visual Basic 6 features that are not directly supported by
the .NET implementation of Visual Basic. Unlike the Visual Basic Runtime,
the compatibility library is not implicitly referenced by all Visual Basic
..NET applications. When you upgrade a Visual Basic 6 project to Visual Basic
..NET, the upgrade wizard adds a reference to
Microsoft.VisualBasic.Compatibility.

The compatibility classes should not be used for new development. The
Microsoft.VisualBasic.Compatibility namespace adds a layer of complexity to
your Visual Basic .NET application and introduces some minimal performance
costs that could be eliminated by recoding portions of the application. In
addition, the Compatibility namespace often contains many classes that wrap
COM objects, and as stated earlier, depending on COM objects is not as
optimal as a pure managed implementation. However, the library itself is not
overly inefficient and the performance costs will probably not be noticeable
in most applications. The rest of this section highlights a few prevalent
Visual Basic 6 compatibility features and their performance characteristics.
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Steve) scripsit:
Having only recently migrated across from VB6 to VB.NET I'm still
unsure whether or not I should be making (heavy) use of the
Microsoft.VisualBasic namespace in new applications. I've read a lot
of posts in the (VB).Net newsgroups and seen just about all of the For
and Against arguments i.e. not using it = not coding in VB.NET, not
using it = good OO. I'm also aware of the difference between this
namespace and the compatibility namespace. [...]
This leads me to believe that there is no issue with me contuining to
use the VB functions I am familiar with.

ACK. You can still use them, sometimes there are not even replacements
for these functions in the .NET Framework. They are handy shortcuts. I
don't have any information from Microsoft about that, but the facts show
that Microsoft made a distinction between the
"Microsoft.VisualBasic.dll" and
"Microsoft.VisualBasic.Compatibility.dll". The latter may be removed in
future, the Visual Basic Runtime Library will remain.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top