Hi,
The enterprise librabry is trying to write an event to the eventlog with a
source that does not exist. When it tries to create this source, it is denied
access and a security exception occures.
You can do one out of 2 things:
1) Disable logging to the eventlog (see help files logging application
block; i do not use it)
2) Log on as an administrator and run your application. It now has access to
the registry so the event source can be created. You can now swicth back to
your original accound and and your application should run.
Hope this helps,
Martijn Kaag
______________________________
www.VECOZO.nl [quoted text, click to view] "shahp@libgotravel.com" wrote:
> Hi,
>
> This is my first time using these forums. So please excuse me if this post
> in the wrong thread.
>
> This is my problem. I am using Visual 2003, .Net framework 1.1 and the
> latest Application Block (enterprise Library 2005)
>
> I configured the DAAB using the Enterprise Library Configuration Screen and
> my application is a very basic one - clicking on a button would fill the
> DataGrid with records
>
> I keep getting this securiy error. Below is the description
>
> An unhandled exception of type 'System.Security.SecurityException' occurred
> in mscorlib.dll
> Additional information: Requested registry access is not allowed.
>
> Below is the stack
>
> Stack Trace:
> [SecurityException: Requested registry access is not allowed.]
> Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
> System.Diagnostics.EventLog.FindSourceRegistration(String source, String
> machineName, Boolean readOnly)
> System.Diagnostics.EventLog.SourceExists(String source, String machineName)
> System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
> type, Int32 eventID, Int16 category, Byte[] rawData)
> System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
> type, Int32 eventID, Int16 category)
> System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
> type, Int32 eventID)
> System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
> type)
>
> Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances.ReportCounterFailure(String message)
>
> Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances..ctor(String
> categoryName, String counterName, Boolean createNewInstance)
>
> Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.AddPerformanceCounter(String
> category, String[] counterNames, Boolean createNewInstance)
>
> Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.Initialize(String
> counterCategory, String[] counterNames, Boolean createNewInstance, String
> eventLogSource, EventLogIdentifier[] eventIds)
>
> Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent..ctor(String
> counterCategory, String[] counterNames, Boolean createNewInstance)
>
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvent..ctor(String[] counterNames)
>
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent..ctor(String[] counterNames)
>
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent..cctor()
>
>
> Can someone please help (step by step) me exactly what sould I be doing to