Where is the WMI.NET Provider Extension 2.0 in the March CTP?

Hi,

Has anybody found the namespaces, samples, docs how to use the WMI.NET Provider extension 2.0 that should be included in the March CTP (according to the release notes)?

Victor

[203 byte] By [VBADerks] at [2008-3-7]
# 1

Hi Victor

There are no samples or docs available at this point. Following are my personel finding, which might be helpful.

Classes & Attributes are available in System.Management.Instrumentation namespace.

You write you decoupled provider using standard c# class and then docorate various properties and method with appropriate attributes.

using System.Management.Instrumentation;

[ManagementEntity()]
public class JetPlan
{
static int instanceCounter = 0;

public JetPlan()
{
instanceCounter++;
}

[ManagementKey()]
public int PlanId
{
get
{
return instanceCounter;
}
}


private string _pilotName;

[ManagementConfiguration(Mode=ManagementConfigurationType.Apply)]
public string Pilot
{
get { return _pilorName; }
set { _pilorName = value; }
}

[ManagementTask()]
public void SaveIt()
{
}


}

One you have a implemented a Managed Object, you need an installer (provided in WMI APIs) to install your decoupled provider in WMI registry.

// Let the system know that the InstallUtil.exe
// tool will be run against this assembly
[System.ComponentModel.RunInstaller(true)]
public class MyInstaller : DefaultManagementInstaller { }

Once your provider is register with WMI, you can create the object of your managed class and publish it in WMI using following code:

JetPlan inst = new JetPlan ();
Instrumentation.Publish(inst );

Console.ReadLine();

Instrumentation.Revoke(inst);

Thats it; These are the steps required to create a basic decoupled provider using WMI Provider extensions.

Now you can test this provider either using CIM Studio or old instrumentation classes in .net.

Zulfiqar

Zulfiqar at 2007-9-13 > top of Msdn Tech,Visual Studio Orcas,Visual Studio Orcas Install and Setup...
# 2

Is this included with the .Net Framework 3.0?

What do I need to download and from where?

Your answer is greatly appreciated

Naiem at 2007-9-13 > top of Msdn Tech,Visual Studio Orcas,Visual Studio Orcas Install and Setup...

Visual Studio Orcas

Site Classified