Reputation: 934
I have an application I'm working on that involves creation of a lock file while in use. Normally this works fine, but when running it in debug mode it can stop anywhere and not remove the lock file. Is there a way to setup Visual Studio to automatically remove this lock file via a batch file after the debugging stop event has been triggered?
Upvotes: 1
Views: 359
Reputation: 11703
I would do it one of two ways. You can create a build event to delete all lock files. Or you can add conditional compilation.
For example:
#if DEBUG
// add code to remove all existing lock files
// when the program starts
#endif
Upvotes: 2