I love this little bit of code.
if (Debugger.IsAttached)
{
}
If you want your application to do different 'stuff' when you are debugging it, then the above works a treat.
I'm using it now to start a windows service as a console application when I run it in debug mode. (wicked)