I need help figuring out why the Application_Error event on my global.asax
is not working. When I run my web application, I do get an error on the
screen but no log file/record is created. Here is the code I have for the
Application_Error in my global.asax:
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim unhandledException As Exception =
Server.GetLastError().InnerException
If Not EventLog.SourceExists("Mileage Efficiency Calculator") Then
EventLog.CreateEventSource("Mileage Efficiency Calculator",
"Mileage Efficiency Calculator Log")
End If
Dim el As EventLog = New EventLog
el.Source = "Mileage Efficiency Calculator"
el.WriteEntry(unhandledException.Message)
Response.Write("An exceptin occurred: Created an entry in the event
log ")
Server.ClearError()
End Sub
Is this a permission issue? Is there something I need to set up so my
application has the rights to create the new log file?
Thanks for your help.