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 January 14th, 2004, 01:56 AM
Authorized User
 
Join Date: Dec 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access

I am working through the code in Chapter 5 of the book and I am getting the error message below. Can someone tell me how to correct it? Do you need to do something special to the folder that contains the Config files?


An unexpected error has occurred on this page. The system administrators have been notified. Please feel free to contact us with the information surrounding this error.
The error occurred in: http://localhost/CCIPortal/Modules/Users/New.aspx
Error Message: Access to the path "c:\inetpub\wwwroot\CCIPortal\Config\Accounts.Conf ig" is denied.
--------------------------------------------------------------------------------
Stack Trace:
System.UnauthorizedAccessException: Access to the path "c:\inetpub\wwwroot\CCIPortal\Config\Accounts.Conf ig" is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at CCIPortal.Modules.Accounts.ACCOUNTSCONFIGURATION.M oduleConfig.GetSettings() in c:\inetpub\wwwroot\CCIPortal\Modules\Accounts\ACCO UNTSCONFIGURATION\ModuleConfig.cs:line 47 at CCIPortal.Modules.Accounts.ACCOUNTSBUSINESS.Accoun tsTool.GetStates() in c:\inetpub\wwwroot\cciportal\modules\accounts\acco untsbusiness\accountstool.cs:line 16 at CCIPortal.Modules.Users.New.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\cciportal\modules\users\new.asp x.cs:line 53 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()

 
Old January 14th, 2004, 10:40 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Does the ASPNET user account have access to the config folder?

 
Old January 14th, 2004, 11:36 AM
Authorized User
 
Join Date: Dec 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am new to ASP.NET programming. How do I check for this?

 
Old January 14th, 2004, 12:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Navigate to here:
c:\inetpub\wwwroot\CCIPortal

Right click the Config folder and click properties. Then click the Security tab.

You should see users that have access to this folder. You need to add the ASPNET user if it's not already present.

 
Old January 14th, 2004, 02:20 PM
Authorized User
 
Join Date: Dec 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't want to sound like an idiot, but what ASPNET user are you referring to?

 
Old January 14th, 2004, 02:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Everyone has to start somewhere. :)

Once you are on the security tab click 'Add'
Then type your machine name \ aspnet like this:
machinename\ASPNET

A way to look up users:
Click the 'Advanced...' button
Make sure the 'Location' is pointing to the computer name of your computer then click 'Find Now'
This brings up all users on your machine you can select from. You can double click the 'ASPNET' user and click ok a few times.



 
Old January 14th, 2004, 03:11 PM
Authorized User
 
Join Date: Dec 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I did that, but I am still getting the same error message.


 
Old January 16th, 2004, 04:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I'm not sure what to tell you. Anybody else have any suggestions??

 
Old January 18th, 2004, 02:51 AM
Authorized User
 
Join Date: Dec 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the answer to my problem on another posting. I changed the FileStream constuctors in the ModuleConfig.cs files to the following:

FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);



This solved the problem. Thanks for your help!!!


 
Old September 8th, 2004, 09:44 AM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,


I'm having the same problem.
This is what I've already tried:

1 - give ASPNET user reading acess to Config folder, as well as
Accounts.Config file

2 - Added this to Web.Config "<identity impersonate="false" />"

3 - Changed the FileStream constuctors in the ModuleConfig.cs files to the
following:
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);

... and nothing of this made any diference.
It only seems to work if I give ASPNET user or EVERYBODY writing
permissions, but I think that's no supose to be ...?






Similar Threads
Thread Thread Starter Forum Replies Last Post
401.3 Access denied due to Access Control List cforsyth .NET Framework 2.0 8 May 28th, 2009 01:56 PM
SQL Access/ASP.NET data access issue saeta57 SQL Server ASP 1 July 4th, 2004 04:29 PM
SQL Access/ASP.NET data access issue saeta57 Classic ASP Databases 1 July 4th, 2004 03:32 PM
ADE file in Access 2000 <---> Access XP ginoitalo Access 3 April 14th, 2004 09:06 PM
Access XP VBA compatibility issues w/ Access 2000 bourgeois02 Access VBA 1 August 19th, 2003 04:14 PM





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