Manageable Configuration Source exception

Topics: Enterprise Library Core
Mar 4, 2009 at 8:37 PM
I get an exception when I try to generate an adm file from the EntLib Config Tool. The exception is raised when I click save.

The project is a basic WCF service template / EntLib 4.1 / net 3.5 sp1 / VS 2008

Here is the exception detail

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Management.Instrumentation.WmiProviderInstallationException: Exception of type 'System.Management.Instrumentation.WMIInfraException' was thrown.
   at System.Management.Instrumentation.InstrumentationManager.RegisterType(Type managementType)
   at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability.ManagementEntityTypesRegistrar.DoRegisterType(Type type)
   at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability.ManagementEntityTypesRegistrar.SafelyRegisterTypes(Type[] types)
   at Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.Configuration.Manageability.SymmetricStorageEncryptionProviderDataWmiMapper.RegisterWmiTypes()
   at Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.Configuration.Manageability.SymmetricStorageEncryptionProviderDataManageabilityProvider..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Manageability.ExportAdmTemplateNodeCommand.GetManageabilityProviders(IServiceProvider serviceProvider)
   at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Manageability.ExportAdmTemplateNodeCommand.TryAndExportAdmTemplate(ManageableConfigurationSourceElementNode sourceNode)
   at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Manageability.ExportAdmTemplateNodeCommand.ExecuteCore(ConfigurationNode node)
   at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ConfigurationNodeCommand.Execute(ConfigurationNode node)
   at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ConfigurationUICommand.Execute(ConfigurationNode node)
   at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.UI.ConfigurationMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.MenuItem.MenuItemData.Execute()
   at System.Windows.Forms.Command.Invoke()
   at System.Windows.Forms.Command.DispatchID(Int32 id)
   at System.Windows.Forms.Control.WmCommand(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at Microsoft.Practices.EnterpriseLibrary.Configuration.Design.UI.CustomTreeView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Mar 5, 2009 at 6:24 AM

What editor are you using? is it the standalone or the visual studio integrated? I tried generating ADM templates using the integrated and my VS just crashes, but when I used the standalone, i got your error. Anyway, I manage to solve this by "Installing the Instrumentation" Start > All Programs > Microsoft Patterns and Practices > Ent Lib 4.1 > Install Instrumentation . Please try that and see if it works on your side. Anyway, here is a link , Using Group Policy and WMI with Enterprise Library. this may become useful somehow.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
Mar 5, 2009 at 10:03 AM
Thanks for the reply Valiant

I tried running the install script but no joy. I think I had done it anyway when I originally
installed EntLib.

I have tried using both integrated and external editors. I have checked that I am using
MS signed assemblies throughout. I have re-installed EntLib. I am stumped. Anymore

I forgot to mention that I am running Vista Ultimate SP1  X86

Dick Page
Mar 5, 2009 at 10:16 AM
More info

It works on EntLib 3.1. Why could that be ...?
Mar 6, 2009 at 2:57 AM

Is it exactly the same exception that you get after installing the instrumentation? also check if you have administrative privilages as mentioned here : 

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
Mar 6, 2009 at 6:10 PM
Yep, its the same exception and yes I have admin privilege.

When I get around to it I'll copy and paste the templates from the documentation rather than
generate them and see if the Group Policy and WMI functionality works.
Mar 9, 2009 at 9:30 AM
I think your Instrumentation for 4.1 is not properly installed or probably corrupted. just like whats on this thread: . Maybe you can try, in a clean machine with ent lib 4.1 only and no other version installed, then you try my first solution.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.