System.Management and System.Management.Instrumentation Namespaces
The System.Management namespace is the object model for management elements in the .NET Framework. The System.Management namespace tightly integrates management services with the .NET Framework applications and development tools to make .NET Framework applications more manageable, providing .NET Framework developers with health monitoring and troubleshooting capabilities in enterprise environments. Applications can also be managed by numerous third-party management applications, as well as through custom consoles, which can easily be written by IT organizations that capitalize on System.Management.
The following illustration identifies the three WMI tiers and identifies how System.Management is layered on WMI: Microsoft Windows Forms (Windows Forms), Web Forms/ASP.NET, and management applications can act as clients that access WMI instrumentation. Management providers can be either existing code that surfaces system or application instrumentation, or Windows Forms and Web Forms/ASP.NET Page Framework applications that expose management instrumentation about themselves to other clients.
The WMI architecture in the .NET Framework
The System.Management namespace provides a set of managed-code classes through which .NET Framework applications can access and manipulate management information provided from any source, such as Windows, native applications instrumented with WMI, as well as managed code instrumented with System.Management.Instrumentation. For simplicity, the classes in the System.Management namespace are sometimes referred to as the WMI client API, but by no means is it the only way to access WMI. Developers can use other technologies to access WMI, such as the native WMI COM interfaces (known as the IWbem interfaces), or the Automation-compatible WMI objects (known as the SWbemScripting objects). As shown in the illustration, when a Windows Forms-based, Web Forms-based, or traditional management application needs to determine how much memory a computer has, configure a network connection, or check the state of an IIS server, it can use a couple of lines of code to access the relevant data. The same is true for many other management tasks.
This functionality is supported by a set of WMI tools built in to the Microsoft Visual Studio .NET development environment. For example, the Visual Studio .NET Server Explorer Management Extension (downloadable from http://www.microsoft.com/downloads/release.asp?ReleaseID=31155) can be used to aid in development of management-aware applications.
Similarly, System.Management.Instrumentation is just one of several ways to provide information through WMI. The two namespaces are in no way dependent on each other. In other words, if you are providing information with System.Management.Instrumentation, this does not limit the visibility of your instrumentation to just the System.Management classes. If you use the System.Management classes, this will allow you to access to any WMI information, not just the instrumentation written using System.Management.Instrumentation.
The current version of System.Management.Instrumentation does not support the following WMI features. Note that this limitation applies only to managed code instrumented objects. Objects exposed through native C++ WMI providers can still expose these features, which will be accessible from managed code through System.Management classes.
- Instrumented objects cannot expose writeable properties or methods.
- Creation of qualifiers on instrumented objects is not supported.
- Properties of instrumented objects cannot be defined as keys.