RE: Exception Handling Block not writing to Vista Event Log



Dear TomM,

I'm sorry if I misunderstood you. Based on my understanding, you have a
setup project, in the Install() method, you call the CreateEventSource()
method to create an event source key named "Driver Documents Manager" in
the register while installing. This key will be used in your application to
log the exceptions. When you run the application on a Vista machine, when
trying to log an exception, the application crashes and no messages written
to the event log if you don't run the application as Administrator.

I notice that in your app.config file, the source of the log listerner is
the default value "Enterprise Library Logging", but you do not register
this source("Enterprise Library Logging") in the register while installing,
so the application will try to create this event source key in the register
when logging for the first time, for OS versions before Vista, it's OK, but
for Vista, it requires Administrator privileges to create register key, by
default the application is not run as Administrator, so the creation fails,
resulting no message written to the event log.

However, if you run the application as Administrator, the "Enterprise
Library Logging" event source key will be created properly, so the next
time, since the "Enterprise Library Logging" event source key exists, even
you don't run the application as Administrator, the logging process will
work.

So to fix the problem, you have two choices:

1. Change the source of trace listener to "Driver Documents Manager";
2. Add an event source key named "Enterprise Library Logging" in the
register in the Install() method as well.

By the way, as setup packages generally require Administrator privileges to
complete sucessfully, the creating of register keys while installing should
work on Vista as long as the installing could run.

=========== Your app.config file ============

<loggingConfiguration name="Logging Application Block" tracingEnabled="true"
defaultCategory="Default Category"
logWarningsWhenNoCategoriesMatch="true">
<listeners>
<add source="Enterprise Library Logging" formatter="Text Formatter"
log="Application" machineName=""
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuratio
n.FormattedEventLogTraceListenerData,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="None"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.Formatted
EventLogTraceListener,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Formatted EventLog TraceListener" />
</listeners>

==========================================

Should you have any questions, please feel free to let me know.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • RE: Exception Handling Block not writing to Vista Event Log
    ... the register while installing. ... to the event log if you don't run the application as Administrator. ... this source("Enterprise Library Logging") in the register while installing, ... so the application will try to create this event source key in the register ...
    (microsoft.public.vsnet.general)
  • Re: Roadmap Review - My Questions
    ... Well before shhing me and telling me you would never espouse such a thing as if it were illegal and unethical, let us remember the exact context of my suggestion - you were expressing a real fear that sometime in the future you wouldn't be able to activate and register an older fully licensed legal version of Delphi because the activation and registration service had been discontinued. ... And there hasn't been a history of activation crackers installing malware, it's shareware and freeware that has the bad history of installing undesirable malware. ... A code escrow service would be a partial solution - as long as the complete build environment was also in escrow, with the ability to strip the activation sequence out and recompile. ...
    (borland.public.delphi.non-technical)
  • Re: Upgrading to Tiger converted Office to "test drive version"
    ... You can't convert a test drive to regular by registering anyhow, ... Haven't a clue why upgrading to Tiger would cause this. ... If y'all didn't remove the test drive before installing the full version, ... > and I wasn't able to register. ...
    (microsoft.public.mac.office)
  • Re: Need some urgent help with error message please...
    ... The web components I use are Microsoft Office Spreadsheet 11.0 and Microsoft ... > that we're installing the correct version for OWC. ... Find OWC10.DLL and register it manually with regsvr32. ...
    (microsoft.public.vsnet.general)
  • Re: Installing DSO ..
    ... You could register these com objects by using regsvr32.exe. ... >Subject: Re: Installing DSO .. ... >The DSO library is what Analysis Manager uses to build/manage OLAP ...
    (microsoft.public.sqlserver.datawarehouse)