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..
#pragma autorecover
#pragma namespace("\\\\.\\root")
instance of __Namespace
{
Name = "cimv2";
};
#pragma namespace("\\\\.\\root\\cimv2")
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);
};