Ole
Ole

Reputation: 1

C# Classes tagged with [InstrumentationClass(InstrumentationType.Instance)] attribute are not being installed in the WMI

I have a C# class library with classes that uses the WMI.

In the assembly info I have this included

//Windows Instumented Configuration.
//http://msdn.microsoft.com/en-us/library/system.management.instrumentation.wmiconfigurationattribute.aspx
[assembly: WmiConfiguration(@"root\Flyware", HostingModel = ManagementHostingModel.LocalSystem)]
[assembly: Instrumented("root/Flyware")]

I have some classes like this one


using System.Management.Instrumentation;

namespace Flyware.AdapterModule.Instrumentation
{
    /// <summary>
    /// WMI Class For Adapter Plugin 
    /// </summary>
    [InstrumentationClass(InstrumentationType.Instance)]
    public class AdaptorClass
    {
        /// <summary>
        /// Name Of The Published Adapter
        /// </summary>
        public string Adpater { get; set; }

        /// <summary>
        /// Current State Of The Adpter
        /// </summary>
        [ManagedName("State")]
        public string State { get; set; }
    }
}

Then I have the installer class

using System.ComponentModel;
using System.Management.Instrumentation;


namespace Flyware.AdapterModule
{
    [RunInstaller(true)]
    public class AdapterInstaller :  DefaultManagementInstaller
    {
    }
}

I run the installutil and get this.

C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod>installutil Flyware.AdapterModule.dll
Microsoft (R) .NET Framework Installation utility Version 4.8.9032.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.dll assembly's progress.
The file is located at C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.InstallLog.
Installing assembly 'C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.dll'.
Affected parameters are:
   logtoconsole =
   logfile = C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.InstallLog
   assemblypath = C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.dll
**** WMI schema install start ****
**** WMI schema install start ****
**** WMI schema install end ****

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.dll assembly's progress.
The file is located at C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.InstallLog.
Committing assembly 'C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.dll'.
Affected parameters are:
   logtoconsole =
   logfile = C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.InstallLog
   assemblypath = C:\Dev\els-solution\source\eLS-Clients\adapterservice\Flyware.Adapter.PluginModule\bin\Prod\Flyware.AdapterModule.dll
Microsoft (R) MOF Compiler Version 10.0.22621.2506
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: C:\WINDOWS\system32\wbem\Flyware.AdapterModule_v4.0.30319.mof
MOF file has been successfully parsed
Storing data in the repository...
Done!



The Commit phase completed successfully.

The transacted install has completed.

I notice these lines **** WMI schema install start **** **** WMI schema install start **** **** WMI schema install end ****

and expect the classes to be installed in the wmi.

How ever I only see the namespace in WHI

Result in wmi

Earlier installations had more classes in it and looked different

Earlier result in wmi with adapterclass

Has something changed in the way the WMI get updated ?. Why am I not seeing the adapter class ?.

Any advise on moving forward here is greatly appreciated.

I am using windows 11 pro. I have also tried to install on an older os but got the same result.

Upvotes: 0

Views: 24

Answers (0)

Related Questions