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

后端 未结 30 1375
清歌不尽
清歌不尽 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: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.

提交回复
热议问题