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..
#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);
};
Posted 8-Mar-11 22:02pm

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

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,127
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 9 Mar 2011
Copyright © CodeProject, 1999-2014
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