Access to the Path App_Data is Denied: 4 Ways to Fix it

Grant read and write permissions to the wwwroot folder

Reading time icon 3 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

fix access to the path app_data is denied

While trying to execute an app in Visual Studio or publish a website, you often come across the Access to the path App_Data is denied error. It lists the entire path of the file the web app needs to access and edit but can’t do so due to missing permissions!

The access denied error usually appears when Visual Studio doesn’t have the necessary privileges, IIS_IUSRS doesn’t have read and write access to the wwwroot folder, another process is accessing the file, or a third-party antivirus has blocked access to it.

How do I fix the Access to the path App_Data is denied error?

1. Run Visual Studio as an administrator

  1. Right-click on the Visual Studio launcher (.exe file), and select Properties.
  2. Navigate to the Compatibility tab, and tick the checkbox for Run this program as an administrator.run as admin to fix access to the path app_data is denied
  3. Click on Apply and OK to save the changes, then run Visual Studio and check if the access denied error still appears.

2. Grant IIS_IUSRS permissions to access the wwwroot folder

  1. Press Windows + E to open File Explorer, paste the following path in the address bar and hit Enter: C:\inetpubinetpub path
  2. Right-click on the wwwroot folder and select Properties.
  3. Go to the Security tab, and click on Edit.
  4. Now, select the entry that starts with IIS_IUSRS from the list, and tick the checkbox for Full control.modify permissions
  5. Finally, click Apply and OK to save the changes and check for improvements.

If this doesn’t work, give read and write permissions to Network Service and ASPNET. Also, you can give full folder control with the same steps for the App_Data folder to all three, IIS_IUSRS, Network Service, and ASPNET!

3. Terminate any processes accessing the file

  1. Press Ctrl + Shift + Esc to open the Task Manager, and identify any processes that might be accessing the file appearing in the error message.
  2. Select each individually and click on End task.task manager
  3. Once done, you should be able to execute the app.

4. Whitelist the wwwroot folder in your antivirus

If the previous solutions didn’t fix the Access to the path App_Data is denied error it could just as well be an antivirus blocking access to the folder/file. In this case, you could temporarily disable the antivirus and check for improvements.

If the error message disappears, add an exclusion for the wwwroot folder in the installed third-party antivirus solution, and finally re-enable it!

While you are here, discover our top picks for Visual Studio extensions to boost efficiency and productivity.

Which fix worked for you? Share with our readers in the comments section.

More about the topics: visual studio

User forum

0 messages