I am trying to find all the types that this type depends on, including interfaces, abstract classes, enumerations, structures, etc. I want to download the assembly and print a list of all types defined in this and their dependencies.
So far I have managed to find all external types, of which the CLR assembly depends on the use of Mono.Cecil, for example.
using System;
using Mono.Cecil;
using System.IO;
FileInfo f = new FileInfo("SomeAssembly.dll");
AssemblyDefinition assemDef = AssemblyFactory.GetAssembly (f.FullName);
List<TypeReference> trList = new List<TypeReference>();
foreach(TypeReference tr in assemblyDef.MainModule.TypeReferences){
trList.Add(tr.FullName);
}
This list can also be obtained using a mono disassembler, for example, "monodis SomeAssembly.dll --typeref", but this list does not seem to contain primitives, for example System.Void, System.Int32, etc.
, , .
Mono.Cecil ?
, , , , IL , , . .
, .