Logging Application Block doesn't add log entries to Event Viewer on machines other than that on which the application was built

StackOverflow https://stackoverflow.com/questions/2733794

  •  02-10-2019
  •  | 
  •  

Question

I am using the Logging Application Block (of Microsoft Enterprise Library 5.0) to log exceptions in the Event Viewer that occur in my WPF XBAP application.

However, exceptions are only being logged if the application is run on my machine (the machine it was built on). Any other machine it doesn't log anything.

I've tried to find a reason why this might be occurring - I've tried setting requirePermission to false - but to no avail.

Anyone any ideas on why this might be happening?

Was it helpful?

Solution

Logging to eventlog requires rights.

Not sure if this is the problem in your case, but typical scenario is: On dev machine program runs in context of logged on user which is an administrator, when it is deployed it is running in the context of a user with fewer rights.

The other thing to watch out for, is how the app is being deployed, if the OS thinks that the program came from the internet it will restrict what the program can do.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top