简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM