AddThis Social Bookmark Button

Print

An Introduction to the .NET FCL, Part 3
Pages: 1, 2, 3, 4, 5

Related Reading

VB.NET Core Classes in a Nutshell
By Budi Kurniawan, Ted Neward

ASP.NET web services

Microsoft.VisualBasic



System

System.Collections

System.Data

System.Diagnostics

Class libraries

Microsoft.VisualBasic

System

System.Collections

System.Data

System.Diagnostics

Console applications

Microsoft.VisualBasic

System

System.Collections

System.Data

System.Diagnostics

Web control libraries

Microsoft.VisualBasic

System

System.Collections

System.Data

System.Diagnostics

System.Management

Windows applications

Microsoft.VisualBasic

System

System.Collections

System.Data

System.Diagnostics

System.Drawing

System.Windows.Forms

Windows control libraries

Microsoft.VisualBasic

System

System.Collections

System.Data

System.Diagnostics

System.Drawing

System.Windows.Forms

Windows services

Microsoft.VisualBasic

System

System.Collections

System.Data

System.Diagnostics

In addition, the AssemblyInfo.vb file automatically imports two additional namespaces, System.Reflection and System.Runtime.InteropServices, into every project.

You can have Visual Studio automatically import a particular namespace, which makes it available to all of the source code files in a project, as follows:

  1. Select Project Properties from the main menu, or right-click on the project name in the Solution Explorer window and select Properties from the popup menu to open the properties dialog.

  2. Select Common Properties Imports in the treeview control on the right to display the Imports property page.

  3. Enter the fully qualified name of the namespace you'd like to import in the Namespace dialog and click the Add Import button. Repeat this step for each namespace you'd like to automatically import in the project.

  4. Click OK to close the property page.

While the use of the Imports directive can save a substantial amount of typing, it does mean that the compiler is left to identify the namespace containing a particular type. This means that, if identically named types are found in the imported namespaces, Visual Basic will not be able to determine which type you wish to instantiate. For example, consider the code in Example 1-6, which defines two custom namespaces, each with a class named Person.

Pages: 1, 2, 3, 4, 5

Next Pagearrow