Wrox Programmer Forums
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 September 5th, 2004, 12:54 PM
Registered User
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default security problem...

dear all

How can i solve this error??THX SO MUCH

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 29: if (!EventLog.SourceExists("ThePhile.COM"))
Line 30: {
Line 31: EventLog.CreateEventSource("ThePhile.COM", "Application");
Line 32: }
Line 33: EventLog.WriteEntry("ThePhile.COM", message, entryType);

Source File: C:\wrox\ThePhile\PhilePage.cs Line: 31

Stack Trace:

[SecurityException: Requested registry access is not allowed.]
   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
   System.Diagnostics.EventLog.CreateEventSource(Stri ng source, String logName, String machineName, Boolean useMutex) +445
   System.Diagnostics.EventLog.CreateEventSource(Stri ng source, String logName, String machineName) +11
   System.Diagnostics.EventLog.CreateEventSource(Stri ng source, String logName) +11
   Wrox.ThePhile.Web.PhilePage.LogEvent(String message, EventLogEntryType entryType) in C:\wrox\ThePhile\PhilePage.cs:31
   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

Old September 6th, 2004, 07:20 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts

The ASPNET (or whatever account) needs more permissions. Don't know what is needed for the Event Log...
Old September 7th, 2004, 03:55 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts

You can't create an Event Source with the ASPNET userid.

Your options:
1) do the steps in the Readme.htm file to run ASP.NET with the system account (fine for Development, but a huge security risk for production)
2) Create the Event Source outside of your application
3) Modify the logging to log to a file instead of the EventLog (your only real choice if you want to deploy to a hosted web site)


Similar Threads
Thread Thread Starter Forum Replies Last Post
Security problem dparsons ASP.NET 1.0 and 1.1 Professional 0 January 28th, 2006 02:02 PM
Security problem doctorsom VS.NET 2002/2003 1 December 14th, 2005 03:38 PM
Java Security Problem Stephen Lam Wrox Book Feedback 1 April 12th, 2005 01:56 PM
Security problem hosefo81 PHP How-To 2 February 6th, 2004 11:39 PM
Security Problem Annihilator VS.NET 2002/2003 0 November 26th, 2003 02:01 PM

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