E
Eric
I want to have my trace statements log to the event viewer and have the
following test code in Page_Load:
If Not Page.IsPostBack Then
Try
System.Diagnostics.Trace.Listeners.Add(New
System.Diagnostics.EventLogTraceListener("CustomSource"))
System.Diagnostics.Trace.WriteLine("TestMsg", "Info-Test")
Catch e1 As Exception
Dim str As String = e1.Message
End Try
End If
I get a SecurityException with the message "Required registry access is not
allowed"
I'm not doing anything beyond the default with security at the moment.
Web.config is the default as far as security is concerned.
I am not sure the best approach. I may have to alter the ASPNET account's
permissions, or create the event log by hand (or in any future install
script) but I am reluctant do alter permissions of any accounts. I could
probably create the event log using a RegistryActions install segment but
I'm wondering if there is a better way to do it? Would I need to
impersonate an actual user? Would this work with Forms authentication?
Thanks.
following test code in Page_Load:
If Not Page.IsPostBack Then
Try
System.Diagnostics.Trace.Listeners.Add(New
System.Diagnostics.EventLogTraceListener("CustomSource"))
System.Diagnostics.Trace.WriteLine("TestMsg", "Info-Test")
Catch e1 As Exception
Dim str As String = e1.Message
End Try
End If
I get a SecurityException with the message "Required registry access is not
allowed"
I'm not doing anything beyond the default with security at the moment.
Web.config is the default as far as security is concerned.
I am not sure the best approach. I may have to alter the ASPNET account's
permissions, or create the event log by hand (or in any future install
script) but I am reluctant do alter permissions of any accounts. I could
probably create the event log using a RegistryActions install segment but
I'm wondering if there is a better way to do it? Would I need to
impersonate an actual user? Would this work with Forms authentication?
Thanks.