Reputation: 1415
I am trying to publish my project from my development machine to the staging environment. I would right click the project in visual studio and click publish. Most of the files would publish just fine, but a few were giving me problems. In the output log, there were multiple error messages, all stating:
Unable to add ‘XXX.ext’ to the Web site. Unable to add file ‘XXX.ext’. Access is denied (550)
I'm following this : But I don't find the "Read-only" attribute checkbox...
So have you any ideas ? Thanks in advance.
Upvotes: 31
Views: 33327
Reputation: 129
I had same issue. I have followed the below steps to fix the issue:
First of all you have to identify that which account you are accessing visual studio. In my case, I have used my organization account.
Upvotes: 0
Reputation: 2600
If you only get this for select files:
Apparently this can occur when Source Control non-checked out files are read only, and then someone just copies specific files.
(I tried other people's suggestions: giving myself write access to wwwroot, running VS as admin, but for me it was the read-only that did the trick.)
Upvotes: 15
Reputation: 1
This is a permission issue. I solved this by giving Full control under 'Security' tab for Users for the deployment folder.
Upvotes: 0
Reputation: 4898
Are you LOCAL administrator to your own PC? If not, that could be the problem and it's how I solved the issue at work.
Upvotes: 0
Reputation: 3881
We had to add full path to publish location. So whereas the publish location used to be:
\webtest1\W_Apps
We did this:
\webtest1\D$\webdata\Intranet\Depts\SO\W_Apps
and then we didn't have the error message
Upvotes: 1
Reputation: 481
In my case, I already tried to uncheck the 'Read-only' in the problem folder and files but still doesn't work. I already run the VS as administrator. What I did is just simply restart the visual studio and publish the project again, and it solves the problem.
Upvotes: 1
Reputation: 2740
it has permission problem of your web server You must go to physical address of your website and share in with user of ftp account that you've create before and and your problem solve
Upvotes: 0
Reputation: 1
The solution for me was to recycle the Application Pool for the website in IIS. I had this problem (access denied) for a few of the folders in the publish directory and none of the above solutions worked for me. After I recycled the app pool, I was able to publish with no problems.
Upvotes: 0
Reputation:
If you have already published your solution and now it is not publishing, then run the Visual Studio on Administration mode and then publish it.
Upvotes: 1
Reputation: 909
Open visual studio in administrator mode. It solved my problem.
Upvotes: 21
Reputation: 25224
I just solved this problem on my own system. It was a permissions issue. What I had to do was grant "write" rights to myself on the IIS directory (in my case wwwroot). I retried the publish from Visual Studio and it worked perfectly.
Upvotes: 32