DanielM Posted December 14, 2006 Posted December 14, 2006 Does anybody know a way how to programatically obtain all referenced types of a Type object? I mean a similar funtion to Lutz Roeder's .NET Reflector's Analyzer -> Depends on... function but I need to utilize it from C# code. Is an API for Lutz Roeder's .NET Reflector available? It must be since there are many Add-Ins available for it, but I can't find it... Thanks in advance. Daniel Quote
Leaders snarfblam Posted December 14, 2006 Leaders Posted December 14, 2006 Try opening reflector with reflector. I don't know what is inside, but I know it runs on the .Net framework, so it is possible that Reflector.exe is the API. As far as determining what classes another class depends on (without using third party libraries), all that should be involved is looping through all the members of a class and determining what types each field/property/return/parameter is. Quote [sIGPIC]e[/sIGPIC]
DanielM Posted December 15, 2006 Author Posted December 15, 2006 Try opening reflector with reflector. I don't know what is inside' date=' but I know it runs on the .Net framework, so it is possible that Reflector.exe [i']is[/i] the API. I had the same idea, but Reflector's code seems to be obfuscated... :D It is possible to see its dependencies - just .NET stuff, nothing else. As far as determining what classes another class depends on (without using third party libraries), all that should be involved is looping through all the members of a class and determining what types each field/property/return/parameter is. IMO examining the method/property signatures and the member types is not enough. What's about the types that are referenced by the implementation (property or method bodies) of the class? It seems to me like Reflector is interpreting the MSIL byte code :o But there must be an API since there are so many AddIns for it... Quote
mskeel Posted December 15, 2006 Posted December 15, 2006 I had the same idea' date=' but Reflector's code seems to be obfuscated...[/quote']Reflector isn't open source? I guess I never realized that until just now. I wonder why it is not. With regards to add-ins, it might be worth checking out the add-ins workspace to see if there is some more info there. Quote
Leaders snarfblam Posted December 16, 2006 Leaders Posted December 16, 2006 I had the same idea, but Reflector's code seems to be obfuscated... [/Quote] You really ought to double check that. I noticed that many classes were obfuscated, but I also noticed dozens upon dozens of public classes and interfaces (specifically, in the CodeModel and CodeModel.Memory namespaces) where the only obfuscated members were private fields. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.