The requested operation cannot be performed on a file with a user-mapped section open

后端 未结 28 1570
深忆病人
深忆病人 2020-12-07 16:03

Whenever I tried to copy 4 files into my bin folder, after stopping the main service, I am getting an error with one file (TexteDll). The error is:

Cannot co         


        
相关标签:
28条回答
  • 2020-12-07 16:38

    Are you running any Anti-virus software. It's possible that the AV software (or some other piece of software) was reading the file using the file mapping APIs which caused the problem.

    0 讨论(0)
  • 2020-12-07 16:39

    Others have already established that this error is due to another application having a lock on the file. Just wanted to point out that git diff locks files as well until you quit out of it. That's what caused this in my case.

    0 讨论(0)
  • 2020-12-07 16:40

    I had the same issue. How I resolved it was:

    1. Open "Task Manager"
    2. End task "Explorer.exe"
    3. Click "File" --> Create new task -- Type in "explorer.exe" --> OK
    4. Clean my project and it works
    0 讨论(0)
  • 2020-12-07 16:43

    In my case I had to kill a hanging MSBuild.exe process that was locking the file (it was there even after I closed Visual Studio).

    0 讨论(0)
  • 2020-12-07 16:44

    My issue was also solved by sifting through the Process Explorer. However, the process I had to kill was the MySQL Notifier.exe that was still running after closing all VS and SQL applications.

    0 讨论(0)
  • 2020-12-07 16:45

    in my case deleted the obj folder in project root and rebuild project solved my problem!!!

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