title: How to detect if an unmanaged native debugger is running the current .NET application?
body: <p>How do I check if a C# program is being put into a debugger in C#? The OS is Windows 10. I have tried to check the user of the person running the program, but it always gave me the current user logged in. Does anyone have any ideas on how I can do this?</p>
  <p>Note: This question is marked as a duplicate because someone thought it was a duplicate of <a href="https://stackoverflow.com/questions/48461396/how-to-detect-if-debugging">this</a>, but its not. By checking if a program is being put into a debugger I mean checking if the program is being reverse engineered. An example of a debugger is <a href="https://x64dbg.com/" rel="nofollow noreferrer">this</a>. I also got a comment saying &quot;If the program is being debugged, the user of the debugger can circumvent your checks.&quot;, I'm aware they can circumvent my checks, but I would still like to check.</p>