
Microsoft’s .NET initiative affected many different technologies, but few technologies have changed as much as
VB 6.0. In order to support the concepts and ideas of .NET, VB 6.0 has undergone a complete rewrite – to its
benefit. This section starts previewing some of the major changes. First, we will investigate some of the
common criticisms of VB 6.0 and see how VB addresses them.
We will also touch upon new object-oriented capabilities including inheritance and parameterized constructors
as well as structured exception handling. The OO features of VB will be examined in greater detail later in the
class.
Introducing Visual Basic Under the .NET Platform
Microsoft’s VB language was first introduced in 1991, however it was based on BASIC, a language developed in
the 60’s. Over the years, Microsoft’s VB language has adopted some strange syntax and behaviors, which may
have been appropriate years ago but now seems horribly outdated. Inconsistencies have grown as new
constructs were added and old constructs were retained for backwards compatibility.
When Microsoft designed .NET, they decided to start fresh with their BASIC language. The priority was to
modernize VB and make it more consistent. Backwards compatibility was NOT a requirement. Furthermore,
VB had to change to meet the standards defined by the Common Language Specification (CLS).
In a great number of cases, existing VB 6.0 code can remain VB 6.0 code. The .NET platform supports COM
and .NET interoperability, therefore new VB code can easily communicate with legacy VB 6.0 COM servers.
In the (rare) cases that you do need to upgrade a VB 6.0 project into the .NET platform, do know that Visual
Studio does support a VB upgrade wizard. When you open a legacy *.vbp file, the upgrade wizard launches
automatically.
This five-step wizard will preserve your existing code base, create a brand new folder with your converted
source code and generate an *.htm summary report. Like any tool, there may be some conversion issues you
will need to rectify by hand. Given this possibility, this HTML-based report can be very helpful indeed. You
will find this report within your Solution Explorer window, available from the View menu.
New VB projects built with Visual Studio automatically reference the VB 6.0 compatibility assemblies:
• Microsoft.VisualBasic.dll: Contains managed definitions of legacy VB 6.0 functions and helper
classes (such as the MsgBox() function).
• Microsoft.VisualBasic.Compatability.dll: The assembly rounds out the types found in Microsoft.
VisualBasic.dll with additional types to allow you to work with control arrays.
Given the presence of these assemblies, it is possible to make use of legacy programming constructs when
building .NET assemblies. However, do so with caution, as we can’t guarantee these assemblies will be
supported in future editions of the .NET platform. We will not be making use of the types within the
compatibility assemblies in this class, and focus of “pure .NET” code.
Copyright (c) 2008. Intertech, Inc. All Rights Reserved. This information is to be used exclusively as an
online learning aid. Any attempts to copy, reproduce, or use for training is strictly prohibited.
Introducing VB.NET
Table of Contents
Courseware
Training Resources
Tutorials
Services