I\'ve got a C# webforms
app, that until today had been working just swimmingly.
Now today, all of a sudden, every time I try run the app, I get a file l
Little late to anwer, but I solve this by going to the properties of the project > tab "Debug" > uncheck "Enable the Visual Studio hosting process".
I had faced the same issue. I tried Several Solutions listed above but they didn't work for me.
I solved this issue by Closing the Connection from the Server Explorer and closed all the Tabs which was open in the Visual Studio.
If this is an SSIS project, then open task manager and kill all instances of DtsDebugHost.exe, that should release the locked files.
I had this issue (and its an issue I have seen in other places not just VS).
It's caused by Dropbox (in my case). After editing some code and hitting run, sometimes dropbox immediately locks the file (so it can process it).
Solution 1. Just hit run again
Solution 2. Pause dropbox. (not good if your using dropbox as your cloud backup)
Solution 3. Remove the build folder from dropboxes sync list.
I use Visual Studio Code and I received this error because the dev server was running (I ran the dev server by pressing Ctrl + F5
).
Thus, I just clicked on the stop sign to stop it and the error went away.
What we have discovered here, is the following: In the project properties page, Debug tab, uncheck the "Enable visual studio hosting process". I am unsure what this property is for, but it does the work once unchecked.