Datasheet

The preceding list of referenced libraries is for .NET 4, so if you instead create a project that targets .NET
2.0, this list will be shorter. Keep in mind that changing your target framework does not update any existing
references. If you are going to attempt to target the .NET 2.0 Framework, then you ll want to remove references
that have a version higher than 2.0.0.0. References such as System.Core enable new features in the System
namespace that are associated with .NET 3.5.
To review details about the imported and referenced namespaces, select the References tab in your project
properties display, as shown in Figure 1 - 10. This tab enables you to check for unused references and even
defi ne reference paths. More important, it is from this tab that you select other .NET Class Libraries and
applications, as well as COM components. Selecting the Add drop - down button gives you the option to add
a reference to a local DLL or a Web service.
FIGURE 1 - 10
When referencing DLLs you have three options: Reference an assembly from the GAC, reference an assembly
based on a fi le path, or reference another assembly from within your current solution. Each of these options
has advantages and disadvantages. The only challenge for assemblies that are in the GAC is that your
application is dependent on what is potentially a shared resource. In general, however, for assemblies that
are already in the GAC, referencing them is a straightforward, easily maintainable process.
In addition to referencing libraries, you can reference other assemblies that are part of your solution. If
your solution consists of more than a single project, then it is straightforward and highly recommended
to use project references in order to enable those projects to reference each other. While you should avoid
circular references Project A references Project B which references Project A using project references
is preferred over fi le references. With project references, Visual Studio can map updates to these assemblies
as they occur during a build of the solution. It s possible for Visual Studio to automatically update the
referenced assemblies in your executable project to be the latest build of the referenced DLLs that are part
of the same solution. Note that the target needs to be an executable. Visual Studio will automatically update
references between DLL projects in a common solution.
Visual Basic Keywords and Syntax
23
CH001.indd 23CH001.indd 23 4/5/10 11:56:38 AM4/5/10 11:56:38 AM