ExceptionPolicy.HandleException does not install Event Source for Logging in Registry if XBAP run ou

Posted by Neo on Stack Overflow See other posts from Stack Overflow or by Neo
Published on 2010-05-05T21:18:15Z Indexed on 2010/05/06 2:58 UTC
Read the original article Hit count: 594

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.

© Stack Overflow or respective owner

Related posts about windows-registry

Related posts about xbap