This project has moved and is read-only. For the latest updates, please go here.

ID string from System.Reflection.MemberInfo?

Topics: Developer Forum
Dec 15, 2012 at 11: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 8:51 PM
Edited Dec 15, 2012 at 8: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.