I find C# a very interesting language and it also comes handy to analyze ILASM code.To examine destructors and how to write custom destructor we will compile from command line the following:
class
System.GC.Collect();System.GC.WaitForPendingFinalizers();
during execution we will notice that both constructors are executed and only in the end both destructors. The idea comes from famous web site "How to write unmaintainable code" chapter about recycling variable names. Of course "noisy" constructor is needed to see that. Something like:
public
.method family hidebysig
To implement catch we are doing the same as with C# code. If we are dealing with exception it will be at top of the stack. This is the code:
.assembly
You will probably prefer to log error to file. Tip: declare static void where you will do logging and pass to it error description in string. Try it, it's not difficult and could be useful in your future work with .NET platform.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: