none
Exe files constantly being deleted from Projects\projectname\Debug folder.

    Question

  • I'm working on a project for my CS-150 class, so I'm a programming and VS newb, and I'm having some tech troubles. I'm running Visual Studio 2010 Ultimate (downloaded via MSDNAA) and it (or something else) seems to be deleting my project.exe files.

    I don't know what it causing this, but it is driving me batty! At seemingly random times, when I try to debug I'll get the following message:

    "Unable to start program C:\Users\Admin\Documents\Visual Studio 2010\Projects\projectname\Debug\projectname.exe" "The system cannot find the file specified."

    I go to the location and sure enough, the exe file is gone. But it was there before. I've been getting this error since I downloaded Visual Studio 2010 Ultimate, and have gotten into the habit of confirming the exe file's existence after the first debug. It'll work fine for a bit and then *poof* disappear. I have no idea where it goes, or how to get it back.

    Here is an example of a working file, with the .exe still in it:
    C:\Users\Admin\Documents\Visual Studio 2010\Projects\OneLastTry\Debug\OneLastTry.exe

    And a file that WAS working but no longer has the .exe:
    C:\Users\Admin\Documents\Visual Studio 2010\Projects\Lab2Prj\Debug

    I can't see a difference in the three, short of the fact that only one has the executable that it should. I've double and triple-checked to be sure that files are being sent to the right place, but to no avail. Has anyone had this problem, or know how to fix it? I obviously don't know enough about the program to know what it's doing to my files. xD


    • Edited by Mholnic Sunday, September 4, 2011 12:46 AM spelling
    Sunday, September 4, 2011 12:45 AM

Answers

  • Pre- Postbuild-events are commands Visual Studio runs before your build starts or after your build did end.
    You may find them after selecting project in Solution Explorer under
    Project->Properties->Configuration Properties->Build Events->Post-Build Event or Pre-Build Event
    and check, if there is something unusual.
    Another proposal, you may consider: For monitoring 'file activity' in a folder you may try using Procmon.exe from Sysinternals.
    Filtering for Path (probably C:\Users\Admin\Documents\Visual Studio 2010\Projects\Lab2Prj\Debug, or name of folder, where you expect deletion) and Operation SetDispositionInformationFile.
    Then Detail Delete: True will show, when file is deleted and which Process is responsible.

    No warranty
    With kind regards

    • Proposed as answer by eryang Thursday, September 15, 2011 7:48 AM
    • Marked as answer by eryang Thursday, September 22, 2011 6:45 AM
    Sunday, September 11, 2011 6:42 PM

All replies

  • What's the programming language you're using? C++, C# or something else. Did you use any post-build event there?
    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, September 8, 2011 3:20 AM
  • C++. I don't know what you mean by post-build event. (CS Newbie.) Basically it will debug just fine for a while, and then at some point the files in the debug folder (including the .exe) will disappear and it'll start saying it can't find them.
    Friday, September 9, 2011 6:25 PM
  • Pre- Postbuild-events are commands Visual Studio runs before your build starts or after your build did end.
    You may find them after selecting project in Solution Explorer under
    Project->Properties->Configuration Properties->Build Events->Post-Build Event or Pre-Build Event
    and check, if there is something unusual.
    Another proposal, you may consider: For monitoring 'file activity' in a folder you may try using Procmon.exe from Sysinternals.
    Filtering for Path (probably C:\Users\Admin\Documents\Visual Studio 2010\Projects\Lab2Prj\Debug, or name of folder, where you expect deletion) and Operation SetDispositionInformationFile.
    Then Detail Delete: True will show, when file is deleted and which Process is responsible.

    No warranty
    With kind regards

    • Proposed as answer by eryang Thursday, September 15, 2011 7:48 AM
    • Marked as answer by eryang Thursday, September 22, 2011 6:45 AM
    Sunday, September 11, 2011 6:42 PM
  • I go this error too; My Antivirus was the root of the issue; it deletes unknown programs .. and therefore those freshly generated

    Tuesday, September 18, 2018 2:21 PM