RE: Exception Handling Block not writing to Vista Event Log
- From: v-zhye@xxxxxxxxxxxxxxxxxxxx (Zhi-Xin Ye [MSFT])
- Date: Fri, 19 Sep 2008 08:57:42 GMT
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.
.
- Follow-Ups:
- References:
- Prev by Date: Re: Can Service access networked computer while logged off?
- Next by Date: Setup Project Question
- Previous by thread: RE: Exception Handling Block not writing to Vista Event Log
- Next by thread: RE: Exception Handling Block not writing to Vista Event Log
- Index(es):
Relevant Pages
|