ID string from System.Reflection.MemberInfo?

Topics: Developer Forum
Dec 15, 2012 at 10:53 AM


I'm aware this is not directly related, but you guys here probably know best.

Is there an easy way to get an ID string (i.e. the <member name="..."> attribute) for a given type member obtained through reflection, i.e. System.Reflection.MemberInfo? I'm looking for something reliable that would return the exact same ID that a recent C# compiler would produce.


Dec 15, 2012 at 7:51 PM
Edited Dec 15, 2012 at 7:53 PM

I haven't dug into the MRefBuilder code in much detail to see how it generates the IDs from the reflection data.  The code is probably in there somewhere.  Some of the rules are detailed in the XML comments documentation on MSDN here:

With that info, you may be able to examine the reflection information for the member and its parameters to synthesize a matching member ID.