Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I have .Net WMI Provider extension.

I am Installing my provider using InstallUtil.
If I remove my assembly without uninstalling using InstallUtil.

During installation the MOF file is getting created successfully but it's failing to compile.

It giving error like this...
 
An error occurred while processing item 2 defined on lines 12 - 22 in file C:\Windows\system32\wbem\AMIDiagProvider_v4.0.30319.mof:
Compiler returned error 0x80041026Error Number: 0x80041026, Facility: WMI
Description: Class has instances
 
An exception occurred during the Commit phase of the System.Management.Instrumentation.WMIManagementInstaller installer.
System.Management.Instrumentation.WmiProviderInstallationException: MOF Compilation failed
An exception occurred during the Commit phase of the installation. This exception will be ignored and installation will continue.

I have to do resolve this problem.
Here is my MOF file..
<h1>pragma autorecover</h1>
 
<h1>pragma namespace("\\.\root")</h1>
 
instance of __Namespace
{
  Name = "cimv2";
};
 
<h1>pragma namespace("\\.\root\cimv2")</h1>
 
class WMI_extension : __Win32Provider
{
    string Name = NULL;
    string CLSID = "{2A7B042D-578A-4366-9A3D-154C0498458E}";
    uint32 Version = 1;
    string HostingModel = "Decoupled:COM";
    string SecurityDescriptor = NULL;
    string AssemblyPath;
    string AssemblyName;
    string CLRVersion;
};
 
instance of WMI_extension
{
    AssemblyName = "AMIDiagProvider, Version=2.0.0.1, Culture=neutral, PublicKeyToken=5a8ca95a6684f5be";
    AssemblyPath = "file:///C:/Windows/Microsoft.Net/assembly/GAC_64/AMIDiagProvider/v4.0_2.0.0.1__5a8ca95a6684f5be/AMIDiagProvider.dll";
    CLRVersion = "v4.0.30319";
    CLSID = "{2A7B042D-578A-4366-9A3D-154C0498458E}";
    HostingModel = "LocalSystemHost:CLR";
    Name = "AMIDiagProvider, Version=2.0.0.1, Culture=neutral, PublicKeyToken=5a8ca95a6684f5be";
};
 
instance of __InstanceProviderRegistration
{
    provider = "Wmi_Extension.Name=\"AMIDiagProvider, Version=2.0.0.1, Culture=neutral, PublicKeyToken=5a8ca95a6684f5be\"";
    SupportsDelete = TRUE;
    SupportsEnumeration = TRUE;
    SupportsGet = TRUE;
    SupportsPut = TRUE;
};
 
instance of __MethodProviderRegistration
{
    provider = "Wmi_Extension.Name=\"AMIDiagProvider, Version=2.0.0.1, Culture=neutral, PublicKeyToken=5a8ca95a6684f5be\"";
};
[dynamic(TRUE) : ToInstance , provider("AMIDiagProvider, Version=2.0.0.1, Culture=neutral, PublicKeyToken=5a8ca95a6684f5be") , singleton(TRUE)]
class AMI_Win_QueryManager
{
    [read(TRUE)] string creationTime;
    [static(TRUE) , implemented(TRUE)] boolean ExecuteQuery([ID(0) , in(TRUE)] string XMLQuery,[ID(1) , out(TRUE)] string XMLResult);
};
Posted 8-Mar-11 22:02pm
Comments
Devel81 at 4-Mar-15 4:35am
   
Did you ever fixed the problem? I have the same problem with a WMI Provider Extension. It worked great with .Net 3.5 but when changing to 4.0 it throws the same error when installing on Win 2k12 R2. Even a totally new WMI Provider Extension using .Net 4.0 throws this error.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 405
2 Maciej Los 285
3 ProgramFOX 265
4 Peter Leow 210
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 395
2 Maciej Los 285
3 ProgramFOX 265
4 CHill60 200


Advertise | Privacy | Mobile
Web03 | 2.8.150331.1 | Last Updated 9 Mar 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100