Geeks With Blogs
Shailen Sukul blog
EntLib WMI and Event Log Errors

(taken from http://blog.hishambaz.com/archive/2005/02/02/240.aspx)

“Immediately after installing Enterprise Library, you MUST install the instrumentation and performance counters.

start\All Programs\Microsoft p&p\Enterprise Library\Install Services

This will execute installutil on each of the assemblies and register the performance counters.  I would hope that in the next version of the installer, this option will be automatically executed after the solution is compiled.  Many of you are getting SecurityExceptions caused by not performing this required step.  Please let me know if this fixes the problem for you.

Disabling Instrumentation
I don't recommend it, but if you really want to you can also disable all of the WMI and performance counter instrumentation in Enterprise Library.  This requires a recompile of Enterprise Library, and you will lose valuable performance monitoring data.  

To make the change, Open up the EnterpriseLibrary.sln and modify the Configuration Properties\Build\Conditional Constants of the EnterpriseLibrary.Common project.  Remove the USEWMI;USEEVENTLOG;USEPERFORMANCECOUNTER constants.  By removing these constants, all of the internal Enterprise Library instrumentation will be disabled.  Recompile.”

I had SUCH a nightmare with the logging application block because my client required that the Web Service and Windows Service run under a user account that had lower permissions.

The problem was that the Logging block kept raising Performance counters and this kept slowing down the application because it was trying to write to the Event Log on errors. The above solution helped me to turn off WMI altogether and the application speed improved dramatically!!
Posted on Friday, April 7, 2006 10:34 PM .Net Oddities | Back to top


Comments on this post: Enterprise Library WMI and Event Log Errors

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Shailen Sukul | Powered by: GeeksWithBlogs.net