Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > Wrox Book Feedback
Wrox Book Feedback A forum to submit feedback on Wrox books if other forums on P2P have been unable to address your book-specific needs. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Wrox Book Feedback section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 26th, 2003, 11:27 PM
Registered User
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default access denied in thePhile app C# version sample


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.


(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
Reply With Quote
  #2 (permalink)  
Old June 26th, 2003, 11:55 PM
Registered User
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

This is a follow-up to my previous message.

I fixed the issue and the sample code runs fine.

(It did NOT have anything to do with the processModel userName setting in machine.config.)

As it turns out, I had installed SQL Server 2000 with Security Authentication set to "Windows Only". I changed the database server property to "SQL Server and Windows" and everything worked fine.

(That was MY error, entirely-- but, if you are going to fine tune the installation notes at all, you might want to mention the need for mixed mode authentication in SQL Server.)

I also discovered a workaround by simply commenting out any lines like this...

EventLog.WriteEntry("ThePhile.COM", message, entryType);

...or anything similar, which effectively turns off event logging.

So far, so good.

Thank you, again, for a GREAT book.
Reply With Quote
  #3 (permalink)  
Old August 30th, 2005, 06:49 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts

This is covered in the readme file that comes with the code download. The ASPNET user account doesn't have permission to create an Event Source in ASP.NET 1.1. The book was written with 1.0.

Please use the proper forum for this book:
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
New version of Sample Code available TrevorTaylor BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6 2 August 23rd, 2008 05:06 PM
Access Denied Error in WinForms App scott.ferguson .NET Framework 1.x 3 September 8th, 2006 01:17 PM
The Security problem in running ThePhile web APP crystallac BOOK: ASP.NET Website Programming Problem-Design-Solution 3 July 28th, 2003 01:22 AM
Problems running ThePhile web app kiekar BOOK: ASP.NET Website Programming Problem-Design-Solution 5 July 24th, 2003 07:39 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.