DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 31 Jul 2007 13:44:03 -0700,    posted on: microsoft.public.dotnet.framework.wmi        back       

Thread Index
  1    Chris L


Creating .Net provider with useful CIM metadata?   
So as far as I can figure, creating a WMI provider in .Net has serious 
limitations in that you cannot add metadata to the properties you're exposing.

By this I mean, for example, I might want a WMI property called "Status" 
which is a C# enumerated type (for example: Running, Paused, Down, Error).

Is there any way to expose an enumerated type via the .Net WMI stuff? It 
seems like whatever's installing the .Net WMI class could pretty easily 
reflect into the property and convert it automatically into a CIM "enumerated 
type".

What I have had to do is to create a MOF file that maps to my C# WMI 
provider class. In that MOF file I am able to add the missing stuff. For my 
example above, in the MOF file I have something like:

[Description("The status property contains status information."), 
ValueMap{"0","1","2","3"}: ToInstance ToSubClass, 
Values("Running","Paused","Down","Error"}: ToInstance ToSubClass] sint32 
Status

Then I have to, after running installutil.exe on the executable, run 
mofcomp.exe on the MOF file. Yuck!

Is this really the only way to do an enumeration or to add description 
metadata to the WMI properties?

Thanks.

- Chris
Date:Tue, 31 Jul 2007 13:44:03 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us