The .NET Framework includes two root namespaces: Microsoft and System.
Tip | Your program may include references to many other namespaces. If you add references to development libraries, your program will have access to their namespaces. For example, you might have Amazon.com, Google, eBay, and other development toolkits installed and they come with their own namespaces. Later versions of Windows will also provide namespaces that you may want to reference. Also note that the My namespace provides shortcuts that make common programming tasks easier. For more information on the My namespace, see the section “My” in Chapter 27 and Appendix R. |
The Microsoft root namespace contains Microsoft-specific items. In theory, any vendor can implement .NET languages that translate into Intermediate Language (IL) code. If you were to build such a language, the items in the Microsoft namespace would generally not apply to your language. Items in the System namespace described next would be as useful to users of your language as they are to programmers who use the Microsoft languages, but the items in the Microsoft namespace would probably not be as helpful.
The following table describes the second-level namespaces contained in the Microsoft root namespace.
Namespace | Contains |
---|---|
Microsoft.Csharp | Items supporting compilation and code generation for C#. |
Microsoft.JScript | Items supporting compilation and code generation for JScript. |
Microsoft.VisualBasic | Items supporting compilation and code generation for Visual Basic. Some of the items in this namespace are useful to Visual Basic programmers, mostly for compatibility with previous versions of Visual Basic. |
Microsoft.Vsa | Items supporting Visual Studio for Applications (VSA), which lets you include scripting in your application. |
Microsoft.WindowsCE | Items supporting Pocket PC and Smartphone applications using the .NET Compact Framework. |
Microsoft.Win32 | Classes that handle operating system events and that manipulate the System Registry. |
The System namespace contains basic classes used to define fundamental data types. It also defines important event handlers, interfaces, and exceptions.
The following table describes the second-level namespaces contained in the System root namespace.
Namespace | Contains |
---|---|
System.CodeDom | Classes for representing and manipulating source-code documents. |
System.Collections | Interfaces and classes for defining various collection classes, lists, queues, hash tables, and dictionaries. |
System.ComponentModel | Classes that control design time and runtime behavior of components and controls. Defines several useful code attributes such as Descript?ion, DefaultEvent, DefaultProperty, and Default?Value. Also defines some useful classes such as ComponentResourceManager. |
System.Configuration | Classes and interfaces for working with configuration files. |
System.Data | Mostly ADO.NET classes. Subnamespaces include features for specific kinds of databases and database technologies such as SQL Server, Oracle, OLE DB, and so forth. |
System.Deployment | Classes that let you programmatically update ClickOnce deployments. |
System.Diagnostics | Classes for working with system processes, performance counters, and event logs. |
System.DirectoryServices | Classes for working with Active Directory. |
System.Drawing | Classes for using GDI+ graphics routines to draw two-dimensional graphics, text, and images. |
System.EnterpriseServices | Tools for working with COM+ and building enterprise applications. |
System.Globalization | Classes that help with internationalization. Includes tools for customizing an application’s language and resources, and for using localized formats such as date, currency, and number formats. |
System.IO | Classes for reading and writing streams and files. |
System.Management | Classes for system management and monitoring. |
System.Messaging | Classes for working with message queues to send and receive messages across the network. |
System.Net | Classes for working with network protocols. |
System.Reflection | Classes for working with loaded types. A program can use these to learn about classes and their capabilities, and to invoke an object’s methods. |
System.Resources | Classes to create and manage culture-specific resources programmatically. |
System.Runtime | Classes for working with metadata for compilers, interop services (interoperating with unmanaged code), marshalling, remoting, and serialization. |
System.Security | Classes for security and cryptography. |
System.ServiceProcess | Classes that let you implement, install, and control Windows service processes. |
System.Text | Classes representing various character encodings. Also contains the StringBuilder class, which lets you build large strings quickly, and classes for working with regular expressions. |
System.Threading | Classes for multithreading. |
System.Timers | Contains the Timer class. |
System.Transactions | Classes for working with transactions involving multiple distributed components and multiphase notifications. |
System.Web | Classes for web programming and browser/server interactions. |
System.Windows.Forms | Defines the Windows forms controls. |
System.Xml | Classes that let you manipulate XML files. |