Microsoft Visual Studio error "The operation could not be completed. The file exists." RRS feed

  • Question

  • I am running Visual Studio 2005 Professional with Visual Basic, C++, among others on Windows XP professional with service pack 3.  When I debug (execute) my .cpp program I receive an error that says "The operation could not be completed.  The file exists."  It then prompts me to save the file, and requires that it have a new filename (if I try to overwrite it the same error appears).  At this point I can save it under a different name, delete the original file, rename the new file the same as the old, and it will execute.  I want to avoid this process, however.  I want it to function as it did previously, such that I could simply modify my .cpp file and execute the new code.  What's more, if I do not alter the .cpp code (namely, I open the project and .cpp file without modifying it) it will execute with no error.

    What is causing this problem and how do I fix it?

    I've tried making sure the Protective Storage service is running and also reset packages according to Article ID: 823245 in Microsoft online support articles.  These did not solve the problem.  I have not uninstalled/reinstalled Visual Studio (this is the last solution step provided by the article).

    Monday, February 7, 2011 5:10 PM