Professional Web Applications Themes

Access to the path is denied - ASP.NET

This is error message I've got. Any suggestion would be appreciated. Server Error in '/WebDirectory' Application. ---------------------------------------------------------------------------- ---- Access to the path "CreateFolder" is denied. 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 continued...

  1. #1

    Default Access to the path is denied

    This is error message I've got. Any suggestion would be appreciated.

    Server Error in '/WebDirectory' Application.


    ----------------------------------------------------------------------------
    ----

    Access to the path "CreateFolder" is denied.

    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.UnauthorizedAccessException: Access to the path
    "CreateFolder" is denied.

    ASP.NET is not authorized to access the requested resource. Consider
    granting access rights to the resource to the ASP.NET request identity.
    ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
    Network Service on IIS 6) that is used if the application is not
    impersonating. If the application is impersonating via <identity
    impersonate="true"/>, the identity will be the anonymous user (typically
    IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET write access to a file, right-click the file in Explorer,
    choose "Properties" and select the Security tab. Click "Add" to add the
    appropriate user or group. Highlight the ASP.NET account, and check the
    boxes for the desired access.

    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:



    [UnauthorizedAccessException: Access to the path "aaaaa" is denied.]

    System.IO.__Error.WinIOError(Int32 errorCode, String str) +393

    System.IO.Directory.InternalCreateDirectory(String fullPath, String
    path) +632

    System.IO.DirectoryInfo.CreateSubdirectory(String path) +78

    AJF_Conference.Conf_WebConf_Add.CloneFile_ConfRoom ()

    AJF_Conference.Conf_WebConf_Add.btSave_Click(Objec t sender,
    EventArgs e)

    Indigy.WebCore.UI.WebControls.IndigyToolbarButton. OnClick(EventArgs
    e) +20


    Indigy.WebCore.UI.WebControls.IndigyToolbarButton. RaisePostBackEvent(String
    eventArgument) +59

    System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    sourceControl, String eventArgument) +18

    System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
    +138

    System.Web.UI.Page.ProcessRequestMain() +1277





    ----------------------------------------------------------------------------
    ----

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



    Theerachet Pratoommanee Guest

  2. #2

    Default Re: Access to the path is denied

    Hi,
    I think that the error message is itself self explanatory.
    What it says is that by default the aspnet_wp.exe process runs under a the
    security context of the ASPNet account. This account is not having access
    permissions on the file system. So you need to either give access
    permissions to the ASPNet account (which I would not recommend) or you need
    to make the request run under another users security context.

    I hope I understood the question correctly .

    Sachin Kharsani
    Microsoft Premier Support


    --
    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
    This posting is provided "AS IS" with no warranties, and confers no rights.
    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
    "Theerachet Pratoommanee" <theerachet@indigy.com> wrote in message
    news:eeKfmBrzDHA.1524@TK2MSFTNGP10.phx.gbl...
    > This is error message I've got. Any suggestion would be appreciated.
    >
    > Server Error in '/WebDirectory' Application.
    >
    >
    > --------------------------------------------------------------------------
    --
    > ----
    >
    > Access to the path "CreateFolder" is denied.
    >
    > 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.UnauthorizedAccessException: Access to the path
    > "CreateFolder" is denied.
    >
    > ASP.NET is not authorized to access the requested resource. Consider
    > granting access rights to the resource to the ASP.NET request identity.
    > ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5
    or
    > Network Service on IIS 6) that is used if the application is not
    > impersonating. If the application is impersonating via <identity
    > impersonate="true"/>, the identity will be the anonymous user (typically
    > IUSR_MACHINENAME) or the authenticated request user.
    >
    > To grant ASP.NET write access to a file, right-click the file in Explorer,
    > choose "Properties" and select the Security tab. Click "Add" to add the
    > appropriate user or group. Highlight the ASP.NET account, and check the
    > boxes for the desired access.
    >
    > 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:
    >
    >
    >
    > [UnauthorizedAccessException: Access to the path "aaaaa" is denied.]
    >
    > System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
    >
    > System.IO.Directory.InternalCreateDirectory(String fullPath,
    String
    > path) +632
    >
    > System.IO.DirectoryInfo.CreateSubdirectory(String path) +78
    >
    > AJF_Conference.Conf_WebConf_Add.CloneFile_ConfRoom ()
    >
    > AJF_Conference.Conf_WebConf_Add.btSave_Click(Objec t sender,
    > EventArgs e)
    >
    >
    Indigy.WebCore.UI.WebControls.IndigyToolbarButton. OnClick(EventArgs
    > e) +20
    >
    >
    >
    Indigy.WebCore.UI.WebControls.IndigyToolbarButton. RaisePostBackEvent(String
    > eventArgument) +59
    >
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    > sourceControl, String eventArgument) +18
    >
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection
    postData)
    > +138
    >
    > System.Web.UI.Page.ProcessRequestMain() +1277
    >
    >
    >
    >
    >
    > --------------------------------------------------------------------------
    --
    > ----
    >
    > Version Information: Microsoft .NET Framework Version:1.1.4322.573;
    ASP.NET
    > Version:1.1.4322.573
    >
    >
    >

    Sachin Kharsani[MSFT] Guest

  3. #3

    Default Re: Access to the path is denied

    I agree with Sachin in that you are looking at a permissions issue
    concerning the ASPNET account. It is reccomended that if you need to grant
    permission to a location other than what the Framework absolutely needs you
    should use impersonation so that you are giving the permission only to the
    IIS authenticated user. Also, if you want to make sure of who and what
    permission is needed you can use a tool called filemon from
    [url]www.sysinternals.com[/url]. This tool monitors file access on the machine. You
    would want to restart IIS, run filemon, reproduce the error, stop filemon
    and then look for any Access Denieds in the results. Also it will list what
    account was accessing the location.

    Here is an article on impersonation:
    306158 INFO: Implementing Impersonation in an ASP.NET Application
    [url]http://support.microsoft.com/?id=306158[/url]

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Holly

    Holly Mazerolle Guest

Similar Threads

  1. A very persistant Access To Path Denied Error
    By Mohammad Ali via DotNetMonster.com in forum ASP.NET Security
    Replies: 2
    Last Post: April 8th, 04:28 PM
  2. Access to path is denied...
    By Calvin Willman in forum Dreamweaver AppDev
    Replies: 0
    Last Post: February 26th, 02:34 PM
  3. Access to path denied
    By Bryan in forum ASP.NET Security
    Replies: 0
    Last Post: May 18th, 03:54 PM
  4. Access to Path is denied
    By Maarten in forum ASP.NET Web Services
    Replies: 1
    Last Post: August 30th, 06:15 AM
  5. Replies: 0
    Last Post: July 2nd, 07:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139