Posted on: 5/20/2015 2:45:03 PM | Views : 663

Hi All,
I'm writing a generic error handler for all our apps and there will be a configure option in a resource file that will be set to determine the error logging Mechanism e.g. email support, write a value into a DB, or into the Event Viewer.
I've Written some code that attempts to write to the event viewer, but I receive error's stating that I dont have sufficient privileges. The Solution is currently a Library Project and will be plugged into all new applications that are developed. How do I ensure the dll has the right permissions to write to the event log?
Here's what I have so far:
Assembly assembly = Assembly.GetExecutingAssembly(); string appName = assembly.GetName().Name; var resourceManager = new ResourceManager("ErrorHandler.ErrorResource", assembly); string machineName = resourceManager.GetString("EventLogMachineName"); ...

Go to the complete details ...