Groups | Blog | Home
all groups > visual studio .net enterprise tools > december 2003 >

visual studio .net enterprise tools : Microsoft Application Blocks for .Net - Logging Block


Karuppasamy
12/5/2003 1:34:52 AM
H

I am trying to use the Logging Module provided by Microsoft Application Blocks for .Net

I installed everything as per the Instructions given in the 'Development Using the Logging Block'

But when i am trying to run the sample, i am getting the following error in the Event Viwer


Kindly help me on this

Waiting for your reply
---------------Error Messge in Event Viewer-----------------------

Unable to read and validate the configuration file C:\Program Files\Microsoft Application Blocks for .Net\Logging\Samples\VB\LogLevelSample\bin\EnterpriseInstrumentation.config. The following type(s) cannot be loaded

Microsoft.ApplicationBlocks.Logging.EventSinks.WmiEventSink, Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.EventSinks.BasicLogEventSink, Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink, Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink, Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.EventSinks.MsmqEventSink, Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.EventSinks.SqlServerEventSink, Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.MeteringEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.AdministrativeEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.AdminMessageEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.AuditEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.AuditMessageEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.AuditOperationEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.BaseEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.CommonEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.ComPlusInfo, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.DiagnosticEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.ErrorEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.ErrorMessageEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.ExternalErrorEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.ExternalErrorMessageEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a7

Microsoft.ApplicationBlocks.Logging.Schema.InternalErrorEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.InternalErrorMessageEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.ManagedSecurityInfo, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceCallEnterEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceCallEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceCallReturnEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceDatabaseCommandEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceDatabaseEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceExternalCallEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceExternalEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceExternalReturnEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.TraceMessageEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.WindowsSecurityInfo, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.AdministrativeEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Microsoft.ApplicationBlocks.Logging.Schema.AdminMessageEvent, Microsoft.ApplicationBlocks.Logging.Schema, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd42fb0c69be8a79

Amine Belabbes Nabi
12/5/2003 11:11:11 AM
The problem is that the public key that you have in the .config files doesn't match the one in the GAC
Run this:

C:\Program Files\Microsoft Application Blocks for .Net\Logging>gacutil /l Micros
oft.applicationblocks.logging.schema

copy the key

do a replace in both .config files

It should work.


---
Karuppasamy
12/8/2003 4:05:39 AM
Yes You are right

Once i changed the Public Key Token in the .config files, its working fine

thanks

---
tcw
2/1/2004 6:00:11 PM
After I changed the public key token, I get three events everytime I run
this program, two Information and 1 Error. Is it supposed to be like this?

-tc


[quoted text, click to view]

tcw
2/7/2004 7:03:40 PM
Yes.

Commenting the following code from LogLevelSamples.cs removes the error
event.

/*
ErrorMessageEvent errorMessageEvent = new ErrorMessageEvent();
errorMessageEvent.Severity = 2;
errorMessageEvent.Message = "ErrorMessageEvent";
errorMessageEvent.EventPublishLogLevel = (int)LogLevel.Error;
EventSource.Application.Raise(errorMessageEvent);
*/

-tc

[quoted text, click to view]

AddThis Social Bookmark Button