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

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

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

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

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


当前回答

我有同样的错误,但我正在使用Perforce版本控制。以下是我的解决方法。

关闭强制P4V客户端 重新启动Visual Studio 2010(可能不需要) 重建项目,成功了 我感到特别高兴,同时又感到厌恶

其他回答

在我的例子中,我将一个项目从Windows移植到OSX,使用Visual Studio Community 7.1.5 for Mac。在项目首选项上禁用使用MSBuild引擎(推荐用于这种类型的项目)选项:

只需右键单击MVC项目,然后单击clean选项。我也有类似的问题,在重建之前清理项目为我解决了这个问题。

我的问题在安装Windows Update KB5003637后就开始了。我的VS2019项目之前运行正常,但在安装Windows更新后出现了这个错误。卸载它,项目再次工作。

我也有同样的问题。我得到了与无法复制有关的错误消息,因为访问路径被拒绝。在我的情况下,我所有的dll和xml文件等都放在D:\TFS\Example\Bin\Debug文件夹。

我右键单击Bin文件夹,单击属性,看到属性下的只读复选框被选中。

我取消选中“只读”复选框,然后单击“应用”,然后在显示的新弹出框上单击“确定”。

我回到Visual Studio构建我的解决方案,它给了我错误消息。

Voilaa . .这次它成功地构建了,没有错误。

我不知道这是否完美,但我这样做是为了解决我的问题。

我使用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!