VS2010 throwing "Could not copy the file "obj\x86\Debug\[file].exe" because it was not found."

Ben Pritchard picture Ben Pritchard · Nov 26, 2013 · Viewed 10.6k times · Source

I'm writing a Windows Phone 8 game which requires a number of support desktop applications: level editors etc. Since I only have express versions of VS, I'm using 2010 for Windows Phone to create these (2012 does not offer the ability to create Windows applications, and I need XNA).

Recently, I've been getting an odd error when I try to build: "Could not copy the file "obj\x86\Debug\LevelEditor.exe" because it was not found."

I tried a number of solutions, even going so far as to completely rebuild the solution, re-creating all the class files then copy-pasting the code in from the old files via text editor - nothing works.

This error appears to be completely spurious, almost as if there is some kind of size limitation on my project: playing around with string constants in various classes seems to point to this as I can extend the number of characters in one until the error occurs, then reduce another in a completely different class and the project will build again.

Has anyone else seen this sort of behaviour? And is there a solution, as it's driving me nuts!

Answer

Ben Pritchard picture Ben Pritchard · Mar 29, 2014

As said, Avast was the problem. Thanks!