Is there a C# equivalent to IsDebuggerPresent()?
<p>I did find this code snippet, but it doesn't return true when I'm debugging:</p>

<pre><code>[DllImport("kernel32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
internal static extern bool IsDebuggerPresent();
</code></pre>
