Unable to copy file - access to the path is denied

后端 未结 30 1125
死守一世寂寞
死守一世寂寞 2020-11-30 19:05

I am using Visual Studio 2005. After taking code from version control first, the c#.net application runs correctly. But, after doing some modifications, when I build I am

相关标签:
30条回答
  • 2020-11-30 19:42

    Kill process VBCSCompiler.exe and rebuild.

    0 讨论(0)
  • 2020-11-30 19:44

    I also had same problem. I got error messages that related to cannot copy since access to path denied. In my case all my dll's and xml files and so on are place at D:\TFS\Example\Bin\Debug folder.

    I right clicked on Bin folder and clicked Properties and saw that Read-only check box is checked under Attributes.

    I un-checked Read only check box and cliked Apply and clicked OK on the new popup that is shown.

    I went back to Visual Studio and build my solution which was giving me error messages.

    Voilaa.. This time it build successfully without errors.

    I donot know whether this is perfect but I did this to solve my issue.

    0 讨论(0)
  • 2020-11-30 19:46

    I solved this problem by deleting the contentious files from bin folder and rebuilding the project.

    0 讨论(0)
  • 2020-11-30 19:47

    I use Visual Studio 2013. I faced this problem 2 times:

    1. 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.

    2. 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!

    0 讨论(0)
  • 2020-11-30 19:47

    I re-added all of my non-.NET dependencies / references and it did the trick.

    0 讨论(0)
  • 2020-11-30 19:47

    I was able to resolve the problem by removing the target file which is complaining(in your example "Bin\Debug\test.Resources.xml") from bin folder of target web site and re build it.That fixed it for me.

    0 讨论(0)
提交回复
热议问题