我使用的是Visual Studio 2005。在先从版本控制中获取代码后, c#.net应用程序正常运行。但是,在做了一些修改后,当我建立我得到以下错误:

错误383无法复制文件“..\root\leaf\Bin\Debug\test.Resources.xml”到 “本\调试\ test.Resources.xml”。访问路径“Bin\Debug\test.Resources.xml”是 否认。li.rollmodel

有人知道为什么会出现这个问题吗?

编辑我可以看到我的整个项目源代码文件夹是只读的,我无法删除只读属性。

首先,有人能告诉我如何删除这个文件夹的只读属性吗?我尝试删除它,但只读属性仍然存在。我也从版本控制方面尝试过,但也没有成功。


当前回答

在我的情况下,是反病毒阻止了文件。

其他回答

我尝试了这里的一切,不知何故删除所有的bin和obj文件夹在我的项目没有工作。从其他进程释放文件夹没有任何作用。重启不起任何作用。通过取消主文件夹上的检查来删除每个文件的只读并没有帮助。

每个依赖项最终都将自己添加到问题中。直接在依赖项文件夹中构建,所以我很困惑。我想重复这个问题,但我发现了一个有效的方法。

你知道什么管用吗?

点网清理

我解决了这个问题: 关闭Visual Studio,再次打开并加载解决方案,重新构建解决方案。我的问题发生在使用TFS和VIsual Studio 2010。

如果有人在尝试其他方法之前想要一个额外简单的解决方案。

只需重新启动你的电脑。 打开Visual Studio,尝试重新构建。

我能够通过删除目标文件来解决这个问题(在你的例子中“Bin\Debug\test.Resources.xml”),从目标网站的Bin文件夹中重新构建它。这为我解决了问题。

我使用Visual Studio 2013。我曾两次遇到这个问题:

On first occasion, I was running Visual Studio without Administrator rights. So, I closed VS and started it using 'Run as administrator' option. This solved my problem. On second occasion, I restarted VS many times, every time making sure that I am running it as an administrator. Also, I rebuilt solution many times. But, in spite of that I was getting error. After that, I removed the concerned file from the target location (the file was already present may be from the previous build at the location where it tries to copy to) and rebuilt the solution. After that, error went away and everything ran smoothly!