Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8891839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:50:32+00:00 2026-06-14T22:50:32+00:00

In C# , how does a try catch finally block work? So if there

  • 0

In C#, how does a try catch finally block work?

So if there is an exception, I know that it will jump to the catch block and then jump to the finally block.

But what if there is no error, the catch block wont get run, but does the finally block get run then?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:50:33+00:00Added an answer on June 14, 2026 at 10:50 pm

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

does try/catch affects performance if no exception thrown in try block? how about try/catch/finally
In a Try Catch Finally block, does the finally block always execute no matter
How does a return statement inside a try/catch block work? function example() { try
If I am using a try/catch/finally block where and how should I initialize variables?
Possible Duplicate: Does a finally block always run? I learned that the finally clause
Possible Duplicates: Conditions when finally does not execute in a .net try..finally block In
I used to close an open datareader using the try/catch/finally block: Dim dr As
I've looked at a few other try catch finally questions on here but I'm
Just a note : I know that in Java finally block should never throw
Does Java Connection.close rollback into a finally block?. I know .Net SqlConnection.close does it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.