Yes, the finally block gets run whether there is an exception or not.
Try [ tryStatements ] [ Exit Try ] [ Catch [ exception [ As type ] ] [ When expression ] [ catchStatements ] [ Exit Try ] ] [ Catch ... ] [ Finally [ finallyStatements ] ] --RUN ALWAYS End Try
See: http://msdn.microsoft.com/en-us/library/fk6t46tz%28v=vs.80%29.aspx
Related Contents:
- Why is try {…} finally {…} good; try {…} catch{} bad?
- Is it bad practice to return from within a try catch finally block?
- Try-catch speeding up my code?
- Why catch and rethrow an exception in C#?
- Do try/catch blocks hurt performance when exceptions are not thrown?
- What happens if a finally block throws an exception?
- Will code in a Finally statement fire if I return a value in a Try block?
- try/catch + using, right syntax
- How using try catch for exception handling is best practice
- C# catch a stack overflow exception
- Pattern to avoid nested try catch blocks?
- What is the real overhead of try/catch in C#?
- Does the C# “finally” block ALWAYS execute? [duplicate]
- Using catch without arguments
- A better way to validate URL in C# than try-catch?
- If an Exception happens within a using statement does the object still get disposed?
- Is the “when” keyword in a try catch block the same as an if statement?
- Why can’t control leave a finally statement?
- Why does Try-Catch require curly braces
- If I return out of a try/finally block in C# does the code in the finally always run?
- IsNumeric function in c#
- When to use try/catch blocks?
- How to get the Development/Staging/production Hosting Environment in ConfigureServices
- vs in Generics
- Convert XML String to Object
- Unable to find testhost.dll. Please publish your test project and retry
- Create a menu Bar in WPF?
- Why does C# have break if it’s not optional? [duplicate]
- How to create arguments for a Dapper query dynamically
- App.config: User vs Application Scope
- Single click edit in WPF DataGrid
- two different DLL with same namespace
- Why does a for loop behave differently when migrating VB.NET code to C#?
- Can I override a property in c#? How?
- JWT on .NET Core 2.0
- C# Generics won’t allow Delegate Type Constraints
- What are ‘closures’ in C#? [duplicate]
- What’s the use of the SyncRoot pattern?
- Data Annotation to validate confirm password
- Finding the Concrete Type behind an Interface instance
- How can one generate and save a file client side using Blazor?
- connectionStrings configSource in App.config not working
- In C#, what’s the best way to spread a single-line string literal across multiple source lines?
- Return Custom HTTP Status Code from WebAPI 2 endpoint
- Use FileSystemWatcher on a single file in C#
- object dumper class
- redirect to current page in ASP.Net
- Specifying custom property name when binding object to Web API endpoint
- Am I Running as a Service
- How to Freeze Top Row and Apply Filter in Excel Automation with C#