title: .NET/C#: How to set debugging environment variable COMPLUS_HeapVerify?
body: <p>I need the heap to be verified each time the <a href="http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29#Tracing_garbage_collectors" rel="nofollow noreferrer">garbage collector</a> (GC) finishes its work. I read this can be done by setting the environment variable <code>COMPLUS_HeapVerify</code> to <code>1</code>. But how exactly do I set this variable?</p>
  
  <p>I read this can be done via <strong>Computer/Advanced System Settings/Advanced/Environment Variables</strong> (Windows&nbsp;7), somebody tells I should set up a new <em>system</em> variable (<a href="https://stackoverflow.com/questions/6486282/set-no-debug-heap">here</a>), others tell this should be a <em>user</em> variable (<a href="https://stackoverflow.com/questions/100543/how-do-i-set-specific-environment-variables-when-debugging-in-visual-studio">here</a>).</p>
  
  <p>Is this approach correct and which (system or user) variable should be set?</p>