I have a C # webforms
application that until today has worked smoothly.
Now today, all of a sudden, every time I try to start the application, I get a file lock error:
Unable to copy file "obj \ Debug \ MyProject.exe" to "bin \ Debug \ MyProject.exe". The process cannot access the file "bin \ Debug \ MyProject.exe" because it is being used by another process.
An error when starting an error brings nothing but the obvious, i.e. VS thinks the file is locked. And definitely , Visual Studio itself locks the file, because when I close VS and open it again, the project runs fine - for the first time. When I try to run it a second time, I get a file lock error.
Closing VS and re-opening every time I want to run the application is not a viable solution! How to find out what is blocking a file and not blocking it?
EDIT: Another interesting discovery: I don't even need to run the application. Just compiling it once causes a file lock; I can not compile twice in a row!
This problem is specific to one project in my solution. All other projects work fine and can be executed as many times as I like. This is only one project that itself is locked.
c # visual-studio-2010 winforms
Shaul Behr Feb 27 2018-11-11T00: 00Z
source share