Not answering your question directly -- but I sometimes find that the IDE will run the wrong executable.
For example, my code will be in revision 1.1 and I can compile and run in Debug. Then make changes, say up to version 1.2. Switch to release, compile, and then run. After much confusion, realize that v1.1 debug-compiled code is running.
Cleaning the project does not fix this. I used to clean, then delete the Release and Debug folders within the IDE view, then rebuild. Now, I just never switch from Release to Debug or vice versa, I just pick a configuration and stay with it.
Also, the compiler thinks it is running the correct executable -- and will point to source code as it debugs that has nothing to do with the code actually running (extremely confusing -- as during the line "x++;" you'll notice in the watch window that some other variable has now changed).
[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*