Unable to copy a file from obj\Debug to bin\Debug

后端 未结 30 1209
清歌不尽
清歌不尽 2020-12-02 12:04

I have a project in C# and I get this error every time I try to compile the project:

(Unable to copy file \"obj\\Debug\\Project1.exe\" to \"bin\\Debug

相关标签:
30条回答
  • 2020-12-02 12:30

    Before rebuild the solution, clear the project, stop the IIS and open the "bin" folder property. Uncheck the Read-only Attribute in general tab then rebuild.

    0 讨论(0)
  • I had to go into windows explorer and delete the bin/debug folder as well as the obj/debug folders. Then I cleaned & rebuilt the project.

    0 讨论(0)
  • 2020-12-02 12:32

    Rename the assembly to a different name to solve this issue.

    0 讨论(0)
  • 2020-12-02 12:33

    Disable any Anti Ransomware (like MalwareBytes) running, then the problem should be solved.

    0 讨论(0)
  • 2020-12-02 12:34

    Well i have the same problem, my way to fix it was to stop and disable the "application experience" service in Windows.

    0 讨论(0)
  • 2020-12-02 12:34

    Solution1:

    1. Close the project.
    2. Delete the bin folder.
    3. Open the project.
    4. Build the project.

    Solution2:

    Add the following code in pre-build event:

    attrib -r $(OutDir)*..\* /s

    This command line code will remove the ready-only attribute of "bin" folder. Now visual studio can easily delete and copy new dlls.

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