O'Reilly logo

Professional Visual Basic 2012 and .NET 4.5 Programming by Todd Herman, Gastón Hillar, David McCarter, Rob Windsor, Billy Hollis, Bill Sheldon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Namespaces

Even if you did not realize it, you have been using namespaces since the beginning of this book. For example, System, System.Diagnostics, and System.Data.SqlClient are all namespaces contained within the .NET Framework. Namespaces are an easy concept to understand; in short, the .NET Framework is built using a collection of libraries. These libraries allow for both a hierarchy of classes that are related to a given topic and horizontally for classes that fill in unrelated capabilities.

Namespaces are important to the CLR in that depending on which version of the .NET Framework you are targeting, which class libraries are available may change. As noted different .NET Platforms and Profiles provide an implementation for different features. As such when selecting which version of the .NET Framework and CLR your application will run against, you are selecting which namespaces should be available to it.

What Is a Namespace?

Namespaces are a way of organizing the vast number of classes, structures, enumerations, delegates, and interfaces that a version of the .NET Framework class library provides. They are a hierarchically structured index into a class library, which is available to all of the .NET languages, not only the Visual Basic 2012 language (with the exception of the My namespace). The namespaces, or object references, are typically organized by function. For example, the System.IO namespace contains classes, structures, and interfaces for working with input/output ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required