WMI Event: Instrumented 32 bit vs 64 bit

Topics: Logging Application Block
Sep 1, 2009 at 2:32 PM

We are getting below error when system fires WMI Event.

Could not find a part of the path 'C:\Windows\system32\WBEM\Framework\root\BSInstrumentation\BS.Instrumentation_SN_17d5fec03ac55e87_Version_1.0.0.0.cs'.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)    at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)    at System.IO.StreamReader..ctor(String path, Boolean detectEncodingFromByteOrderMarks)    at System.Management.Instrumentation.SchemaNaming.get_Code()    at System.Management.Instrumentation.InstrumentedAssembly..ctor(Assembly assembly, SchemaNaming naming)    at System.Management.Instrumentation.Instrumentation.Initialize(Assembly assembly)    at System.Management.Instrumentation.Instrumentation.GetInstrumentedAssembly(Assembly assembly)    at System.Management.Instrumentation.BaseEvent.get_FireFunction()    at System.Management.Instrumentation.BaseEvent.Fire()    at BS.Instrumentation.BSWMILogSink.SendMessageCore(LogEntry log)    at Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.LogDistributor.DistributeLogEntry(LogEntry log, CategoryData category)    at Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.LogDistributor.ProcessLog(LogEntry log)    at Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.InProcLogDistributionStrategy.SendLog(LogEntry logEntry)    at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.SendMessage(LogEntry logEntry)    at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object message, String category, Int32 priority, Int32 eventId, Severity severity, String title, IDictionary properties)    at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object message, String category)    at AgreementDetailBasic.logMessage(String sMessage, String sPagePath, String sErrorCategory)    at AgreementDetailBasic.Page_Load(Object sender, EventArgs e)

The same file exist in sysWOW64 folder
C:\Windows\sysWOW64\WBEM\Framework\root\BSInstrumentation\BS.Instrumentation_SN_17d5fec03ac55e87_Version_1.0.0.0.cs

1) We registered BS.Instrumentation.dll (custom WMISink) using C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe
> Not sure why system creating WMI namespace in sysWOW64 folder instead of system32 folder

2) We are runnin web site on 64 bit application pool
> Not sure why system looking the file in system32 folder instead of sysWOW64 folder

Any idea?

We are working with...
EntLib 1.1 version (32 bit),
OS is 64 bit,
Web Site Default Pool 64 bit (Run 32 Bit Application falg = False)

-Brijen

Sep 2, 2009 at 7:36 AM
Edited Sep 2, 2009 at 7:42 AM

I'm not really sure if this is an ent lib question. Have you tried copying the file from the sysWOW64 to the system32 directory, see if it will do the trick?

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com