We've been trying to do this, and we're getting the following exception:
System.Security.SecurityException was unhandled by user code
Message="The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security."
Source="System"
StackTrace:
at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly)
at System.Diagnostics.EventLog.SourceExists(String source, String machineName)
at System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName)
at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type)
at HSLDA.EEntry.Common.Request.Request.Save() in D:\NetProjects2005\EEntry\EEntryRequest\Request.vb:line 169
at _Default.SendApplication() in d:\dev\EEntryGateway\Default.aspx.cs:line 258
at _Default.Page_Load(Object sender, EventArgs e) in d:\dev\EEntryGateway\Default.aspx.cs:line 41
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I assume this is because the ASP.NET process is not allowed to write to the event logs. So, should I:
1) Change permissions so that the ASP.NET process can write to the logs? If so, how do I go about that?
2) Use some other method for writing to the event logs?
3) Run as a different user that has permissions to write to the event log? This seems like an incorrect solution...
4) Something else?
Thanks for any help!
-jb