C# Visual Studio:无法添加到网站...无法添加文件...访问被拒绝错误 550
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9903000/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio: Unable to add to the Web site... Unable to add file... Access is denied Error 550
提问by Razor
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:
我正在尝试将我的项目从我的开发机器发布到登台环境。我会在 Visual Studio 中右键单击该项目,然后单击发布。大多数文件都可以正常发布,但有一些文件给我带来了问题。在输出日志中,有多个错误消息,都说明:
Unable to add ‘XXX.ext' to the Web site. Unable to add file ‘XXX.ext'. Access is denied (550)
无法将“XXX.ext”添加到网站。无法添加文件“XXX.ext”。访问被拒绝 (550)
I'm following this: But I don't find the "Read-only" attribute checkbox...
我正在关注这个:但我没有找到“只读”属性复选框......
So have you any ideas ? Thanks in advance.
那么你有什么想法吗?提前致谢。
回答by Levi Botelho
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.
我刚刚在我自己的系统上解决了这个问题。这是一个权限问题。我必须做的是在 IIS 目录(在我的情况下是 wwwroot)上授予我自己的“写”权限。我重试了从 Visual Studio 发布,它工作得很好。
回答by Greg
If you only get this for select files:
如果您只为选定文件获得此信息:
- Go to Published file folder
- Select the problem Files
- Properties
- 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.)
(我尝试了其他人的建议:给自己写访问 wwwroot 的权限,以管理员身份运行 VS,但对我来说,这是只读的。)
回答by arpan desai
Open visual studio in administrator mode. It solved my problem.
以管理员模式打开visual studio。它解决了我的问题。
回答by arpan desai
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.
如果您已经发布了您的解决方案,但现在它没有发布,则在管理模式下运行 Visual Studio,然后发布它。
回答by Carl Fredrickson
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.
我的解决方案是在 IIS 中回收网站的应用程序池。对于发布目录中的一些文件夹,我遇到了这个问题(访问被拒绝),并且上述解决方案都不适用于我。回收应用程序池后,我可以毫无问题地发布。
回答by alireza
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
它有您的网络服务器的权限问题您必须转到您网站的物理地址并与您之前创建的ftp帐户的用户共享并且您的问题解决
回答by Satria Janaka
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.
就我而言,我已经尝试取消选中问题文件夹和文件中的“只读”,但仍然无效。我已经以管理员身份运行 VS。我所做的只是简单地重新启动visual studio并再次发布项目,它解决了问题。
回答by Michele
We had to add full path to publish location. So whereas the publish location used to be:
我们必须添加完整路径来发布位置。因此,虽然发布位置曾经是:
\webtest1\W_Apps
\webtest1\W_Apps
We did this:
我们这样做了:
\webtest1\D$\webdata\Intranet\Depts\SO\W_Apps
\webtest1\D$\webdata\Intranet\Depts\SO\W_Apps
and then we didn't have the error message
然后我们没有错误信息
回答by Fandango68
Are you LOCAL administratorto your own PC? If not, that could be the problem and it's how I solved the issue at work.
你是本地管理员到自己的电脑?如果没有,那可能就是问题所在,这就是我在工作中解决问题的方式。
回答by MegRoh
This is a permission issue. I solved this by giving Full control under 'Security' tab for Users for the deployment folder.
这是一个许可问题。我通过在“安全”选项卡下为部署文件夹的用户提供完全控制来解决这个问题。

