System.UnauthorizedAccessException: Access denied approach. _win Server

Source: Internet
Author: User
Tags anonymous parent directory stack trace
In the use of Windows2003 system to do ASP. NET when doing project encounters

Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.

Exception Details: system.unauthorizedaccessexception: Access to the path "..." was denied.

Server error in '/' Application.
--------------------------------------------------------------------------------

The access to the path "..." was denied. "


ASP.net is not authorized to access the requested resource. Consider granting the ASP.NET request identity access to this resource. ASP.net has a base process identity that is used when the application has no impersonation (typically, on IIS 5, on IIS 6 for network services). If the application is/> impersonation through <identity impersonate= "true", the identity will be anonymous (usually IUSR_machinename) or authenticated request user.

To grant ASP.net write access to a file, right-click the file in Explorer, select Properties, and then select the Security tab. Click Add to add the appropriate user or group. Highlight the ASP.net account, and select the box that corresponds to the required access rights.

Make me confused!!!

Follow the prompts-click Add to add the appropriate user or group.

Where the "appropriate" is not understandable, see IIS anonymous users are: Iusr_hostel

However, it is useless to add Iusr_hostel related permissions to the folder security.

The Internet also checked some methods, but did not work.

After many attempts I have finally found a solution

Locate the site root | right | security | Click "Add" | click "Advanced" | Click "Find Now"

Check "Authenticated Users" | ok | ok

Make a tick on the check box of the Allow column after modify |

Now try again, run ASP. NET program well.

This and small problems, although not large, but wasted a lot of my time, so find solutions do not enjoy the exclusive, hope to be helpful to everyone.

------Workaround--------------------------------------------------------
Without permissions, you can set the permissions
------Workaround--------------------------------------------------------
HTML permissions are set to either the ASPNET (IIS5) or Network Service (IIS6) writable
------Workaround--------------------------------------------------------
Hen Mingxian le! Quanxian Buzu!
------Workaround--------------------------------------------------------
The virtual host cannot give the network service this account to write permissions on C disk
------Workaround--------------------------------------------------------
Permissions issues, set up, folder right--> permissions--> add everyone and Internet Guest account to Full Control
------Workaround--------------------------------------------------------
The change is the parent directory of the new folder you created. You can add permissions to IIS. Or just add permissions to that parent directory.

if not, you can refer to the following method:

Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.

Exception Details: system.unauthorizedaccessexception: Access denied.

This asp.net process is not authorized to access the requested resource. For security reasons, the default ASP.net process is identified as "{Machinename}aspnet", which has limited privileges. Consider granting the asp.net process identity permission to access this resource.

To grant ASP.net write access to a file, right-click the file in Explorer, select Properties, and then select the Security tab. Click Add to add the "{machinename}aspnet" user. Highlight this asp.net account and select the Write box in the Allow column.


1. Run enter "DCOMCNFG" to set the run permissions for Excel application COM components.

2. Select the component you want to set, properties.

3. Add the ASPNET after all customizations are added to the Security tab. Problem solving, hundred try!

This is not a good time:

Copy the files from the Dcoument and Setting folder to the current user (in order to replicate the original user environment), all other functions can be, that is, when the word process in the program, it will be an error, said permissions, configured permissions will still be an error, The folder for the current user in the Dcoument and Setting folder was later deleted, and everything returned to normal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.