- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello again O' Most Helpful People
Not sure if I'm just not searching for the right phrase, here or elsewhere online, but I'm trying to find a way to automatically delete some files from the $(ProjectDir) as a pred-debug event. Currently I am forced to navigate my way to the directory and manually delete the files (the model crashes if either are present), but after doing this about a billion times it's getting old.
Something akin to the Pre-Build Event would be perfect, only "pre-debug" obviously.
?
Thanks
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There isn't an event that runs on a debug, but I wonder (haven't tried this) if you could replace the "Command" in the Debugging property page with an invocation of a .bat file that does the delete and then runs the EXE? This might not work depending on how the debugger gets control, but it's worth a shot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the main program insert conditional compilation code that expands in Debug build. This code checks the command line for an option switch, you define the switch (e.g. -deleteFiles). This code could always be present if you want.
Then in the Debug Build, Debug command line options, add your secret switch.
When your program starts it tests for this option, if found, it deletes the files (or changes an open STATUS from OLD/UNKNOWNtoREPLACE).
Jim Dempsey

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page