To add an explicit interface implementation, just add a reference to
object.Finalize to the .Overrides collection of your method definition
for the finalizer.

That being said, your method is hidebysig and virtual, and has the
same name and signature as object.Finalize, you shouldn't need it.

Jb




On Fri, Aug 7, 2015 at 9:16 PM, Manuel Eisenschink
<[email protected]> wrote:
> Sorry, something obviously went wrong when I posted that ... Not the same as
> I wrote :-/
>
> .method family hidebysig virtual instance void Finalize() cil managed
> {
>     .override object::Finalize
>     .maxstack 2
>     L_0000: nop
>     L_0001: nop
>     L_0002: ldarg.0
>     L_0003: call instance class [mscorlib]System.Type
> [mscorlib]System.Object::GetType()
>     L_0008: ldarg.0
>     L_0009: ldfld class [App]App.Instancing.InstanceId
> App.Lab.Wpf.MainWindow::_instance
>     L_000e: call bool [App]App.Spy::UnsetToken(class [mscorlib]System.Type,
> class [App]App.Instancing.InstanceId)
>     L_0013: pop
>     L_0014: leave.s L_001e
>     L_0016: ldarg.0
>     L_0017: call instance void [mscorlib]System.Object::Finalize()
>     L_001c: nop
>     L_001d: endfinally
>     L_001e: ret
>     .try L_0001 to L_0016 finally handler L_0016 to L_001e
> }
>
> This is the compiler generated output. I don't necessarily need the
> Try-Finally-Block (at least not yet). But there you see the ".override"
> which is missing in the Cecil-variant.
>
> --
> --
> --
> mono-cecil
> ---
> You received this message because you are subscribed to the Google Groups
> "mono-cecil" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to