Not being able to use 'return in a 'finally block in C# is a
language-design choice; other languages, like Java, JavaScript, allow it. In fact, both those languages allow returns in both catch and finally blocks: the last return defined is what's executed.
There
are some exceptions, like OutOfMemoryException, that will terminate execution before a finally block code is executed, but, in general, the code in a finally block is
guaranteed to execute. You should use a finally block to "clean up," to dispose of things that need disposing.
You can use 'return in the catch block, but, if you have a finally block and a catch block, that sets up the interesting possibility of a variable (declared outside the method) being modified in the catch block
after a method has returned. You can see an example of that here: [
^].
If you really want to go deep into how the .NET compiler under-the-hood transforms to try-catch-finally to IL code, the thread of the above-cited link is quite valuable.
Note that there are some people who have very strong feelings about the way error handling should be done in .NET, and that they advocate always throwing an exception up to some higher level exception handler. There are resources on advanced application-wide error handling strategies here on CodeProject if you care to look.
On a practical basis, I'd say that using return only
after the finally block, if you have handled the error in a catch block, is a best practice.