Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access to the Path Error in Visual Studio

This issue was resolved with SQL Server 2008 R2 Cumulative Update 5 / SP1 / SQL Server 2012 RTM


On occassion when I try to build a Reporting Services project as part of either deploying or previewing a report in Visual Studios I receive the following error:

Access to the path 'C:\My Solution Folder\bin\Debug\My Report.rdl' is denied.

What appears to happen is the file in the \bin\Debug\ folder has been changed to read-only. I can "fix" the symptom by removing the read-only flag on the impacted file. I would like to find a way to avoid this error altogether since this happens usually multiple times a day.

I verified the file is not being saved to my source control system, so it doesn't seem like my source control plugin would cause this problem. The problem seems to have started with SQL Server 2008 R2 and this makes sense given that I am pretty certain the \bin\Debug\ folders didn't exist prior to this version of the Reporting Services project.

I tried changing the project OutputPath to a path that is not under the project folder, but Visual Studios would't allow me to do this.

like image 633
Registered User Avatar asked Jan 21 '11 16:01

Registered User


People also ask

How do I fix a path access error?

To correct this error Any path that is not fully qualified is relative to the current drive and directory. Make sure that you did not attempt to save a file that would replace an existing read-only file. If this is the case, change the read-only attribute of the target file, or save the file with a different file name.

Why is access to the path denied Visual Studio?

Solution for “Access to the path is denied” error The root cause is that the application pool which is hosting your web application is not able to access to the shared folder you specified in your code. Therefore, it throws “Access to the path is denied” message.

How do I fix access denied error in Visual Studio?

0x80070005 - Access Denied To work around this issue, coordinate with your system administrator or other IT professional to make sure that these processes don't lock Visual Studio files. The user who is trying to install Visual Studio doesn't have administrator credentials on the computer.

How do I find my Visual Studio path?

Normally, the path is something like C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ . From Visual Studio, one can use $(VCInstallDir)$ to get this path.


1 Answers

It's a known bug with Microsoft that was corrected by CU5 and later in SP1. The issue did not occur at all in SQL Server 2012 RTM.

https://connect.microsoft.com/SQLServer/feedback/details/543755/fiserv-tap-checking-it-rdl-source-sets-output-folder-to-read-only

Basic workaround is to build once, unset the read-only attribute on all files in the reporting project's BIN folder and it'll all work again...until you edit a file again.

I suspect this is due to VSS marking files as read-only once checked in...VS then copies the resources (*.RDL) to the BIN folder verbatim i.e. with read-only attribute set.

like image 133
AndrewD Avatar answered Oct 12 '22 07:10

AndrewD