Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 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
 
Old July 10th, 2003, 10:12 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch17-entrytolog security problem

I am doing Ch17 entrytolog.aspx. When I run it I get a Security Exception message shown below. I am using windowsXP and have administrator rights. My BegASPNET virtual directory has all rights.
I get a sense that this involves windows security but I don't know where to start. Please advise. Thanks.

gary@electronicmirror.com

Server Error in '/BegASPNET' Application.
--------------------------------------------------------------------------------

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Requested registry access is not allowed.

Source Error:


Line 16: string LogName = "MyApplicationLog";
Line 17: string SourceName = "MyApplicationSource";
Line 18: if(!(EventLog.SourceExists(SourceName)))
Line 19: {
Line 20: EventLog.CreateEventSource(SourceName, LogName);


Source File: C:\BegASPNET\Ch17\entrytolog.aspx Line: 18

Stack Trace:


[SecurityException: Requested registry access is not allowed.]
   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
   System.Diagnostics.EventLog.FindSourceRegistration (String source, String machineName, Boolean readOnly) +295
   System.Diagnostics.EventLog.SourceExists(String source, String machineName) +79
   System.Diagnostics.EventLog.SourceExists(String source) +11
   ASP.entrytolog_aspx.Page_Error(Object sender, EventArgs e) in C:\BegASPNET\Ch17\entrytolog.aspx:18
   System.Web.UI.TemplateControl.OnError(EventArgs e) +109
   System.Web.UI.Page.HandleError(Exception e) +68
   System.Web.UI.Page.ProcessRequestMain() +2065
   System.Web.UI.Page.ProcessRequest() +118
   System.Web.UI.Page.ProcessRequest(HttpContext context) +18
   System.Web.CallHandlerExecutionStep.Execute() +179
   System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +87




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.288; ASP.NET Version:1.0.3705.288

gary@electronicmirror.com
 
Old July 29th, 2003, 04:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Your ASP.NET account must have write permission on the file named C:\WINNT\system32\config\AppEvent.Evt.


...but the Soon is eclipsed by the Moon
 
Old July 30th, 2003, 09:03 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just gave write permission to AppEvent.Evt and to the containing directory but the error message remains the same (Below). I am looking in the Administrative Tools\Event Viewer also but can see no way to adjust security there?

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Requested registry access is not allowed.




gary@electronicmirror.com
 
Old July 31st, 2003, 05:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Are you sure that you assigned appropriate permissions to the account under which this aspx page execute? It is possible that your aspx page execute under IIS anonymous account, or some Windows account, and in that case, you have to add that user into ACL list for the file AppEvent.Evt.
HTH.

...but the Soon is eclipsed by the Moon
 
Old August 2nd, 2003, 09:42 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi and thanks,
  In C:\WINDOWS\system32\config\AppEvent.Evt properties\security tab I have granted all permissions to asp_wp account which is installed with Visual Studio and dot Net Framework. It has worked for everything else. The entrytolog.aspx page inherits this account permission from being in a directory that has explicitly granted permissions for this account.
  I don't really know what an ACL list is if it isn't on the file's security tab under properties?

gary@electronicmirror.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with object pool in ch17 Aiming BOOK: Professional C++ 0 September 5th, 2008 10:31 AM
ch17 php4 hymns BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 August 21st, 2006 04:25 AM
Security Problem Annihilator VS.NET 2002/2003 0 November 26th, 2003 02:01 PM
EntryToLog.aspx -- security error reidcor ASP.NET 1.0 and 1.1 Basics 3 July 24th, 2003 05:05 AM





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