This documentation is archived and is not being maintained.

WmiConfigurationAttribute Class

The WmiConfiguration attribute indicates that an assembly contains code that implements a WMI provider by using the WMI.NET Provider Extensions model. The attribute accepts parameters that establish the high-level configuration of the implemented WMI provider.

Namespace:  System.Management.Instrumentation
Assembly:  System.Core (in System.Core.dll)

[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
public sealed class WmiConfigurationAttribute : Attribute


The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: MayLeakOnAbort. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes.

The following table lists the parameters accepted by this attribute along with what aspect of the provider configuration it enables you to control.




The namespace in which your provider exposes classes.


  • The security (DACL) on the namespace used.


  • The hosting model that will be used by the provider.


  • The impersonation mode of the provider.


The hosting group that the provider belongs to. This parameter only applies to in-process providers.


The security (DACL) on the WMI provider.

// Specify that this assembly contains code that implements a WMI
// Provider. Use the assembly:WmiConfiguration attribute to define
// the WMI namespace, the hosting model, and the impersonation mode
// of the WMI provider.
// The attribute below specifies that the class this provider
// exposes to WMI will be in the root/MortgageCalc namespace, will
// use the decoupled hosting model and will not allow the provider
// to impersonate its callers.

[assembly: WmiConfiguration("root/MortgageCalc",HostingModel = ManagementHostingModel.Decoupled, IdentifyLevel = false)]


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5