Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 6th, 2003, 05:32 AM
Registered User
 
Join Date: Jun 2003
Location: , , Canada.
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
  #2 (permalink)  
Old June 7th, 2003, 05:56 PM
Neo Neo is offline
Registered User
 
Join Date: Jun 2003
Location: Dalian, Liaoning, China.
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.
  #3 (permalink)  
Old June 7th, 2003, 07:30 PM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
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
  #4 (permalink)  
Old June 9th, 2003, 06:49 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Switzerland.
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.
  #5 (permalink)  
Old June 9th, 2003, 07:09 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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
  #6 (permalink)  
Old July 24th, 2003, 07:39 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:46 PM.


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