Is the Microsoft.VisualBasic namespace “true .NET” code?

Microsoft.VisualBasic.dll <> Microsoft.VisualBasic.Compatibility.dll !!!

(or, if you prefer, Microsoft.VisualBasic.dll != Microsoft.VisualBasic.Compatibility.dll; )

The Microsoft.VisualBasic.Compatibility namespace is exclusively for use by the VB6 upgrade wizard, may be removed in future versions, and should not ever be used for new development.

The Microsoft.VisualBasic namespace is absolutely, 100% true .Net, fully supported, and will be around as long as .Net is around.

A few relevant links:

Edit: Added the official word from this MSDN article:

The Visual Basic Runtime provides the
underlying implementation for global
Visual Basic functions and language
features such as Len, IsDate, and
CStr. And though the new Visual Basic
Runtime provides similar facilities as
its predecessors, it is entirely
managed code (developed in Visual
Basic .NET) that executes on the
common language runtime
. Furthermore,
the Visual Basic Runtime is part of
the .NET Framework, so it is never
something separate that your
application has to carry or deploy.

and

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.

Leave a Comment