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 June 6th, 2003, 05:32 AM
Registered User
 
Join Date: Jun 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems running ThePhile web app

Hello,

I just recently purchased the book and downloaded the web app.
Each time I try to run the app I get a Security Exception.
Does anybody have an idea how I can correct this. Any help would
be much appreciated.

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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

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)
   System.Diagnostics.EventLog.SourceExists(String source, String machineName)
   System.Diagnostics.EventLog.SourceExists(String source)
   Wrox.ThePhile.Web.PhilePage.LogEvent(String message, EventLogEntryType entryType) in Q:\Wrox\ThePhile\PhilePage.cs:29
   Wrox.ThePhile.Web.PhilePage.PhilePage_Error(Object sender, EventArgs e) in Q:\Wrox\ThePhile\PhilePage.cs:54
   System.Web.UI.TemplateControl.OnError(EventArgs e)
   System.Web.UI.Page.HandleError(Exception e)
   System.Web.UI.Page.ProcessRequestMain()
   System.Web.UI.Page.ProcessRequest()
   System.Web.UI.Page.ProcessRequest(HttpContext context)
   System.Web.CallHandlerExecutionStep.Execute()
   System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)

Thanks
Karl
 
Old June 7th, 2003, 05:56 PM
Neo Neo is offline
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Neo
Default

I think try to use impersonation first.
Add following code to your web.config file
-----------------------------------------------------------
<system.web>
...
    <identity impersonate="true" userName="Administrator" password="***yourPassword" />
...
</system.web>
-----------------------------------------------------------
and retry

Good Luck!

Neo
What the web can be.
 
Old June 7th, 2003, 07:30 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You are REALLY suggesting that he put his administrator password in pain text in a config file that any user could read?



Hal Levy
Daddyshome, LLC
 
Old June 9th, 2003, 06:49 AM
Authorized User
 
Join Date: Jun 2003
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

This error is related to the application permissions.
ThePhile use the event log to report the application errors.

In order to run this on w2k machine you have to edit your machine.config file and set the username to "SYSTEM" in the <processModel> tag.

On a w2k3 server (IIS6.0) in native mode it's a little bit trickier..:

you have to create a new "Application Pool" and set its Identity property to "Local System"

cheers.
 
Old June 9th, 2003, 07:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In addition to changing the permissions so your code runs fine, you may want to rethink the proposed solution altogether. The biggest problem with creating Event Logs at run time is security. When the possibility was first introduced with early versions of ASP.NET I thought it was quite cool. However, in the mean time Microsoft no longer recommends creating them at run time because of the permissions problems.

If you take a look at the Exception Management Application Block, you can see that the Event Log is now created at install time and then used at run time. This makes it far easier to use......

For more details and hints how to create the event logs, check out:
http://msdn.microsoft.com/library/de...ml/emab-rm.asp

Cheers,

Imar
 
Old July 24th, 2003, 07:39 PM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I changed the userName attribute of processModel (in <system.web>) to "SYSTEM". Then I rebooted. Unfortunately, I'm still getting the same security error. Any ideas why? (BTW, the password attribute is set to "AutoGenerate")

Thanks,

Tim Rogers

Quote:
quote:Originally posted by dikkjo
 Hi,

This error is related to the application permissions.
ThePhile use the event log to report the application errors.

In order to run this on w2k machine you have to edit your machine.config file and set the username to "SYSTEM" in the <processModel> tag.

On a w2k3 server (IIS6.0) in native mode it's a little bit trickier..:

you have to create a new "Application Pool" and set its Identity property to "Local System"

cheers.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems using <xsl:import in web app flanagaj XSLT 0 April 18th, 2006 08:40 AM
How to see if an app is running from a web page darkhalf Javascript 9 October 21st, 2004 11:30 AM
Help - Getting my .ASP web app running on Unix ocarroll Classic ASP Databases 7 July 23rd, 2004 07:25 AM
Problem running web App rwalker ASP.NET 1.0 and 1.1 Basics 1 February 27th, 2004 01:29 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





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