ExceptionPolicy.HandleException does not install Event Source for Logging in Registry if XBAP run ou
- by Neo
I am using the Logging Application Block (of Microsoft Enterprise Library) to log exceptions in the Event Viewer that occur in my WPF XBAP application.
If I run the XBAP in the debugger from Visual Studio, an Event Source entry for my application is automatically created in the Registry at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp
This occurs at the point ExceptionPolicy.HandleException() is called.
However, if I run the XBAP outside of the IDE directly from the file system or from its published location, the Registry entry isn't added. Therefore, no logging takes place.
I can only assume this is a security issue with running XBAP applications and they do not have access to write to the Registry. Is this a setting within my project? Any idea on why this might be happening?
Any help much appreciated.