title: Does the C# "finally" block ALWAYS execute?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/345091/will-code-in-a-finally-statement-fire-if-i-return-a-value-in-a-try-block">Will code in a Finally statement fire if I return a value in a Try block?</a>  </p>
  </blockquote>
  
  
  
  <p>Consider the following code C# code. Does the "finally" block execute?</p>
  
  <pre><code>public void DoesThisExecute() {
     string ext = "xlsx";
     string message = string.Empty;
     try {
        switch (ext) {
           case "xls": message = "Great choice!"; break;
           case "csv": message = "Better choice!"; break;
           case "exe": message = "Do not try to break me!"; break;
           default:
              message = "You will not win!";
              return;
        }
     }
     catch (Exception) {
        // Handle an exception.
     }
     finally {
        MessageBox.Show(message);
     }
  }
  </code></pre>
  
  <p>Ha, after I got done writing this, I realized I could have done tested this myself in Visual Studio. However, please feel free to answer!</p>