Detect debugger

Is it possible to detect if debugger (VS2010) is connected after reboot?

I am trying to write app that switch to Mass storage mode if no debugger is connected.

Yes it is, and has been answered beforeā€¦a quick search on the forum would reveal the post below :wink:

if (System.Diagnostics.Debugger.IsAttached)
              Debug.Print("debugger is present");
                //the LED on your board will light up when running without the debugger
                for (int i = 0; i < 100; i++)
                Debug.Print("No debugger is present");//you won't see this because of no debugger.. can print to the LCD instead.

This is cool, never seen it before