EIF

G

Guest

All,

I am having a problem using the Logging Application Block and EIF with a Windows Service I am writing. If I run the Service under an admin account all works fine. However, If i run it under a normal user account I get the following error message in the EventLog

Error loading an Event Sink of type 'Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink, Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f8ff21927effe54'. The Event Source of name 'DOL.WorkerObject.1' will not write events out to this Event Sink. The following exception was returned during the load:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: Requested registry access is not allowed.
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly)
at System.Diagnostics.EventLog.SourceExists(String source, String machineName)
at System.Diagnostics.EventLog.SourceExists(String source)
at Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink.CreateEventSource()
at Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink..ctor(IDictionary parameters, EventSource eventSource)
--- End of inner exception stack trace ---
at System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at Microsoft.EnterpriseInstrumentation.EventSinks.EventSink.CreateNewEventSinks(DataRow[] eventSinkRows, EventSource eventSource)


It appears that there is some security setting that the service account needs to access this but I can't figure out what setting it is. Does anyone have any ideas? I hate to have to run the service as an Admin just for logging.

Thanks!
 
A

Adlai Stevenson

Dan said:
It appears that there is some security setting that the service account needs to access this but I can't figure out what setting it is. Does anyone have any ideas? I hate to have to run the service as an Admin just for logging.

Did you check the security settings for your app in the assembly cache?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top