bjhuffine
bjhuffine

Reputation: 934

Automatically Run Batch File After Debugging Stops in Visual Studio 2010?

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

Answers (1)

Black Frog
Black Frog

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

Related Questions