Sairama's Interesting Code of the Day
Take note of the Debugger.IsAttached property to find out whether the code is running in debugger or not.
if( System.Diagnostics.Debugger.IsAttached )
// Do special things (give more info to the development user)
Console.WriteLine("Yes, running in debugger");
Console.WriteLine("Not running in debugger");
System.Data.dll uses the above feature to debug Stored procedures. Opens a memory mapped file for enabling debugging of sprocs. It issues sp_sdidebug which is used to turn on or off TSQL debugging.
The code above shows only the features of .NET and in no way suggest/dictates/advices the usage of this particular feature.