Logo 
Search:

C# Answers

Ask Question   UnAnswered
Home » Forum » C#       RSS Feeds
  Question Asked By: Ludwig Fischer   on Jul 16 In C# Category.

  
Question Answered By: Patty Freeman   on Jul 16

Error :Access to the path  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.

Cause: This error occur when an ASP.net attempts to create, modify and delete files at web server. When it try to access file system, Web server first authenticates the request. Web server checks who is making request,it can be ASPNET (default user) or any other existing user.

This settings are dependent on machine.config or web.config files.

By default, this setting is specified as:
<identity impersonate="false" />
With this default setting, the ASP.NET engine will identify itself using the user account ASPNET.

In this error case ASPNET user doesnot have permission to access file/folder,so we have to grant permission to ASPNET user.

Error Solutions: 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.

How to make identity setting so that ASP.NET Web application would access the file system using the desired user.

Set impersonate="true"
Optional userName and password attributes can also be specified, to identify the user account that the ASP.NET engine should use when accessing the file system.

Share: 

 
 
Didn't find what you were looking for? Find more on Error :Access to the path is denied? Or get search suggestion and latest updates.


Tagged: