Share via


WMI.NET Provider Extensions Installation

The WMI.NET Provider Extensions make it easy to register and install the providers you create. How you register providers in the WMI repository is the same regardless of which provider hosting model you use: in process or decoupled. In either case, instead of creating and compiling Managed Object Format (MOF) files yourself like you would if you were creating an unmanaged provider, you include the following code in the assembly that implements your provider.

[System.ComponentModel.RunInstaller(true)]
public class TheInstaller : DefaultManagementInstaller
{
}

After compiling your library or executable, you then run installutil.exe providing the name of the library or executable as a parameter. The installutil.exe tool interacts with the DefaultManagementInstaller class to register your provider and associated WMI class information in the WMI respository.

When you run installutil, it displays verbose output. If the registration procedure fails, there is often useful error information in that output. Look for the sentence

In Process

An in-process provider is hosted by the WMI service. It is implemented as a DLL and must be stored in the Global Assembly Cache (GAC). Note that the DLL must be signed in order to register it in the GAC by using the gacutil command line tool. You can sign your assembly by changing Visual Studio project settings. Display the project properties by selecting Project Name Properties… on the Project menu or by pressing Alt-F7. The Signing section of the properties page includes a Sign the assembly option.

Decoupled

An decoupled provider is only available when its host application is running. You do not need to register the host executable. Instead, you need to ensure it is running.

Send comments about this topic to Microsoft.

Copyright © 2007 by Microsoft Corporation. All rights reserved.