title: Visual Studio: edit-and-continue on handled exceptions?
body: <p>Here's a code reproducing the behavior I'm expecting to get:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          // try // #2
          {
              string x = null; // #1
              AssertNotNull(x, nameof(x));
          }
          // catch (ArgumentNullException) { } // #2
          Console.WriteLine("Passed.");
          Console.ReadKey();
      }
  
      [DebuggerHidden]
      public static void AssertNotNull&lt;T&gt;(T arg, string argName) where T : class
      {
          if (arg == null)
              throw new ArgumentNullException(argName);
      }
  </code></pre>
  
  <p>The behavior is the same for any VS starting from VS2008 (did not check on earlier versions).</p>
  
  <p>If you run it under debug (using a standard debugging settings) you're not allowed to continue until you fix the code (using the EnC). Hitting F5 will just rerun assertion due to <code>[DebuggerHidden]</code> and "Unwind stack on unhandled exception" setting combo (setting is enabled by default). </p>
  
  <p>To fix the code, just replace the #1 line with <code>object x = ""</code>, set the next statement to it and hit F5 again.</p>
  
  <p>Now, enable "break when thrown" for the ArgumentNullException and uncomment the lines marked with #2.
  The behavior changes: you're stopped on assertion again, but the stack does not unwind (easy to check with CallStack window). F5 will continue from the place the exception was thrown.</p>
  
  <p>Ok, so... now the question is:
  Is there any way to enable auto stack unwinding when breaking on <strong>handled</strong> exceptions?</p>
  
  <p>Hidden VS option, existing extension or (maybe) API that can be used from my own extension?</p>
  
  <p><strong>UPD:</strong> To clarify the question:  I want to break at the line with failed assertion, edit the code with edit and continue, set next statement to the fixed code and continue the execution.</p>
  
  <p>As it works if the exception is not caught down the stack.</p>
  
  <p><strong>UPD2</strong> As proposed by Hans Passant: Posted <a href="https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/13293105-edit-and-continue-should-work-for-handled-exceptio" rel="nofollow">an suggestion on UserVoice</a>. Feel free to vote:)</p>