1

我有一个项目,其类扩展了 WMI 事件并用于通过 WMI 发布数据。班级看起来像这样(整个班级的几行):

[InstrumentationClass(InstrumentationType.Instance)]
public class PointInstrumentation
{
    private bool enabled = true;

    // static data
    public string UserName { get; set; }
    public string EffectiveUserName { get; set; }
    public string Environment { get; set; }
    public string Universe { get; set; }
    public int AppProcessId { get; set; }
    public string ProcessName { get; set; }
    public string AppHostName { get; set; }
    public string Keyword { get; set; }
    public string Version { get; set; }
    public string OrbAddress { get; set; }
    public string ApiVersion { get; set; }

..

     public void Publish()
    {

            System.Management.Instrumentation.Instrumentation.Publish(this);

..

如您所见,它使用属性声明“[InstrumentationClass(InstrumentationType.Instance)]”进行扩展

我的问题是,当我注册 dll 时,我在 WMI 资源管理器中看不到 PointInstrumentation 类,因此,我无法查询正在发布的内容。

谁能解释一下我做错了什么以及注册WMI(c#)类的适当方法。

谢谢

4

0 回答 0