System.UnauthorizedAccessException: method of processing access denied.

  • 2020-05-07 20:40:40
  • OfStack

Doing ASP with Windows2003 system. NET was working on a project

Note: during the execution of the current Web request, an unhandled exception occurred. Check the stack trace for details about the error and the source of the error in the code.

Exception details: System.UnauthorizedAccessException: for the path "..." Access was denied.

Server error in the/application.
--------------------------------------------------------------------------------

The path "....................." Access was denied.


ASP.NET is not authorized to access the requested resource. Consider granting ASP.NET a request to identify permission to access this resource. ASP.NET has a base process id that is used when the application is not emulated (typically, {MACHINE}\ASPNET on IIS 5, and network service on IIS 6). If the application is going through < identity impersonate="true"/ > Impersonation, the identity will be either the anonymous user (typically IUSR_MACHINENAME) or the authenticated requesting user.

To grant write access to a file to ASP.NET, 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 for the required access rights.

Make me 1 head fog water!!

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

The word "appropriate" is not easy to understand. The anonymous user in IIS is IUSR_HOSTEL

But adding the relevant permissions for IUSR_HOSTEL to folder security doesn't help at all

The Internet also looked up some methods, but did not work.

After many attempts, I finally found a solution

Go to the root of the site |, right click | security |, click "add" |, click "advanced" |, click "find now"

Select "Authenticated Users" | to confirm that | is ok

Check the box that allows columns after modification with a check mark | to determine

Now try again. Run asp. Okay, net.

This is not a small problem, but it has wasted me a lot of time, so I dare not enjoy it alone after finding a solution, I hope it can be helpful to everyone.

Solution -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
No permissions, set the permissions can be
Solution -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
The permission of Html is set to ASPNET(iis5) or network service(iis6) to be writable
Solution -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
hen mingxian le ! quanxian buzu !
Solution -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
The virtual host cannot give network service this account write permission to the c disk
Solution -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
Permission problem, set 1, folder right - click > Authority -- > The plus Everyone and Internet guest accounts are set to full control
Solution -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
Change the parent directory of the folder you created. You can add permissions on iis. Or just give permission to that parent directory. .

If not, please refer to the following method:

Note: during the execution of the current Web request, an unhandled exception occurred. Check the stack trace for details about the error and the source of the error 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" and has only limited privileges. Consider granting the ASP.NET process permission to access this resource.

To grant write access to a file to ASP.NET, right-click the file in explorer, select properties, and then select the security TAB. Click add to add the user {machinename}ASPNET. Highlight this ASP.NET account and select the write box in the allow column.


1. In operation, enter "dcomcnfg" to set the operation permission of excel Application com component.

2. Select the components and properties to be set.

3. Add aspnet to the security card after all customizations.

When that doesn't work:

The Dcoument And Setting folder User1 file copy of the user to the current user (in order to reproduce the original user environment), other functions can be entirely, is when word process in the program, will be an error, said permission is wrong, after configure permissions or complains, then delete Dcoument And Setting folder of the current user folder, 1 cut back to normal.

Related articles: