Here's a useful bit of information. If you need to know if you are running your program in debug mode or not you can do this :
#if DEBUG
// Program is running in debug mode
#endif
Here's an example of why this is useful. Say you are creating a Windows Service and we all know how boring and time consuming it can be to install the service, test it, make modifications or fixes and then test it all again, not to mention you can't debug it properly. If you put this in the main class file