access denied in thePhile app C# version sample
Hello.
Please help.
I am trying to get thePhile sample code running for C# on my local workstation.
(The book is "ASP.NET Website Programming - Problem, Design, Solution - C# Edition", ISBN 1-86100693-4, Copyright 2002.)
(The book is excellent and I really appreciate it.)
However, I am getting the error below.
It looks like it has to do with the event logging. I checked and made sure that I DID do this, as instructed in the setup instructions...
Open Machine.Config (by default in C:\WINNT\Microsoft.NET\Framework\v1.0.3705\CONFIG) in a text editor, find the <processModel> section, and set the userName attribute to "SYSTEM". This is required to enable event logging in ASP.NET Applications -- which we use in our custom error handling. Reboot the computer. This will enable the change to Machine.Config to take effect
...for both this...
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\CONFI G
...and this...
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFI G
...and it still does not work.
I am going to try to turn off event logging, but I would still like to know the answer here.
Any ideas?
Please advise.
Thank you.
--Mark.
(Note that the context here is VS.NET 2002 + SP2, .NET Framework 1.1, Windows XP Pro.)
Server Error in '/ThePhile' Application.
--------------------------------------------------------------------------------
Access is denied
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: Access is denied
Source Error:
Line 31: EventLog.CreateEventSource("ThePhile.COM", "Application");
Line 32: }
Line 33: EventLog.WriteEntry("ThePhile.COM", message, entryType);
Line 34: }
Line 35:
Source File: C:\wrox\ThePhile\PhilePage.cs Line: 33
Stack Trace:
[Win32Exception (0x80004005): Access is denied]
[InvalidOperationException: Cannot open log for source {0}. You may not have write access.]
System.Diagnostics.EventLog.OpenForWrite() +367
System.Diagnostics.EventLog.WriteEvent(Int32 eventID, Int16 category, EventLogEntryType type, String[] strings, Byte[] rawData) +280
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +463
System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +68
System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category) +21
System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID) +15
System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type) +11
Wrox.ThePhile.Web.PhilePage.LogEvent(String message, EventLogEntryType entryType) in C:\wrox\ThePhile\PhilePage.cs:33
Wrox.ThePhile.Web.PhilePage.PhilePage_Error(Object sender, EventArgs e) in C:\wrox\ThePhile\PhilePage.cs:54
System.Web.UI.TemplateControl.OnError(EventArgs e) +109
System.Web.UI.Page.HandleError(Exception e) +68
System.Web.UI.Page.ProcessRequestMain() +2094
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +87
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
|