Chris Lukas

I am trying to create a C#-based .Net WMI provider to instrument an application I am developing.

Classes and events work well except I would like to have an event that provides a member which is an enumerated type.

Example:

public enum StatusList

{

Running,

Paused,

Stopped

}

[InstrumentationClass(InstrumentationType.Event)]

public class StatusChange : System.Management.Instrumentation.BaseEvent

{

public StatusList Status;

}

It seems to me that WMI supports enumerated types because they appear in the server explorer. Also when I generate C# WMI classes using that class generator, I get enumerated types in those classes.

When I run the code above, I get the following error:

"The member 'Status' has a declaration that is not supported. Use the IgnoreMember attribute.\r\nParameter name: Status"

How do I declare an enumerated type as a property of a .Net WMI class or event

This seems really important to creating WMI providers in .Net so I'm hoping there is a simple answer...

Thanks.

Chris