Determine type implementing the interface

21 views
Skip to first unread message

Walter Stocker

unread,
Feb 8, 2019, 11:22:36 AM2/8/19
to mono-cecil
Hi,

unfortunately I was unable to find an answer in the group or with a google search. Therefore, I am posting here and hope that somebody can answer my question.

I have the following code that I would like to analyze with Cecil:

public class FooClass {


   
private IFooInterface myField = new FooInterfaceImplementor();



Is there a way to determine the type FooInterfaceImplementor with Cecil? I am only able to get IFooInterface as the type of the field.

Regards,

/Walter

Greg Young

unread,
Feb 8, 2019, 11:49:15 AM2/8/19
to mono-...@googlegroups.com
Look in the constructor where this would be set... *note however* that something else could be setting it elsewhere to some other IFooInterface ...

--
--
--
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 mono-cecil+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Studying for the Turing test

Walter Stocker

unread,
Feb 8, 2019, 4:45:50 PM2/8/19
to mono-cecil
Hi,

thanks for the hint. In the meanwhile I stumbled over a post talking about looking at the IL code of the constructor and then I figured that this is propably the way to do it.

Thank you!

Regards,

/Walter
Reply all
Reply to author
Forward
0 new messages