Razor
Razor

Reputation: 1415

Visual Studio: Unable to add to the Web site... Unable to add file... Access is denied Error 550

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

Answers (11)

Thamizh
Thamizh

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.

  1. Go to your deployment which you set as "Target Location" in publish profile
  2. Right click the deployment folder
  3. Go to Security tab
  4. In the list of users, identify the account using which you are accessing Visual Studio ( in my case organization account)
  5. Grant full permission by checking the check box "Full control" and click "Apply"

Upvotes: 0

Greg
Greg

Reputation: 2600

If you only get this for select files:

  1. Go to the Server Published file folder
  2. Select the problem Files
  3. Properties
  4. Uncheck Read-Only

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

MegRoh
MegRoh

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

Fandango68
Fandango68

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

Michele
Michele

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

Satria Janaka
Satria Janaka

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

Alireza
Alireza

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

Carl Fredrickson
Carl Fredrickson

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

user3057303
user3057303

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

arpan desai
arpan desai

Reputation: 909

Open visual studio in administrator mode. It solved my problem.

Upvotes: 21

Levi Botelho
Levi Botelho

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

Related Questions