Tech Off Thread

6 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Something wrong with the localhost!

Back to Forum: Tech Off
  • User profile image
    Nicolas.NET

    Has anyone seen the following before in their ASP.NET Websites? Please help fast! My project is due on Friday! Thanks.
    Paths to local directories have been sheilded.

    Server Error in '/' Application.

    Server cannot access application directory
    <PATH TO LOCAL DIRECTORY>
    . The directory does not exist or is not accessible because of security settings.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Server cannot access application directory
    <PATH TO LOCAL DIRECTORY>
    . The directory does not exist or is not accessible because of security settings.

    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:

    [HttpException (0x80004005): Server cannot access application directory <PATH TO LOCAL DIRECTORY>. The directory does not exist or is not accessible because of security settings.]
    System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263

    [HttpException (0x80004005): ASP.NET Initialization Error]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +982
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128


    Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

  • User profile image
    FluffyDevil​Bunny

    I've gotten this error before when ACLs followed files that were copied into the web directory. Anotherwords the ASP.Net account didn't have privaleges to the directory or a file.

    First try this:

    Go to you web root directory. I am going to assume that you are allowing anonymous access and don't have alternate permissions set on anything such as virtual directories/web applications. If so, post back.

    Right-Click on your root directory and select Properties.

    Click the Security Tab

    You should see the Internet Guest Account listed which has not privaleges selected but Write access Revoked and Special Privaleges Revoked (but greyed out because only certain ones have been revoked).

    Click Advanced

    Check Replace permission entries on all child objects with entries shown here that apply to child objects.

    Click Apply or OK.

    The "OK Yourself" out of the dialog windows.

    That is how I fix the problem each time it has happened. If anyone else has a better way to do this or know of a way to prevent if from happening, I would love to hear about it.

    FDB

  • User profile image
    Nicolas.NET

    Well, I sent the same error report to the lecturer and she came back with this...

    "Where is your Virtual Directory set to? and does the ASPNET user have permissions on the directory?"

    So apparently, there IS a virtual directory. But I can assure it is set to where my project resides, because all the other files are viewable using the localhost URL, except the ones with the aspx extension, which all carry the error report.

    How do I set the ASPNET permissions?

  • User profile image
    FluffyDevil​Bunny

    Ah!

    Does your project reside in your Profile Directory? Anotherwords is it located in a folder on your desktop or in My Documents. IIS can't read from a users profile directory only you and an Administrator can do that.

    Setting your ACL privs on those directories is not a good thing.

    Also is this code residing on your computer or on another?

    FDB


  • User profile image
    Nicolas.NET

    FluffyDevilBunny wrote:
    Ah!

    Does your project reside in your Profile Directory? Anotherwords is it located in a folder on your desktop or in My Documents. IIS can't read from a users profile directory only you and an Administrator can do that.

    Setting your ACL privs on those directories is not a good thing.

    Also is this code residing on your computer or on another?

    FDB


    I have put them into wwwroot or into C: and they work!

    Thanks, FDB!

    You rock! Rock on!

  • User profile image
    FluffyDevil​Bunny

    Awesome.

    Glad I could help. Wink

    FDB

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.