Hey, On Mon, Jan 25, 2010 at 1:01 PM, Damian <[email protected]> wrote: > 1. Having a FieldDefinition/PropertyDefinition/MethodDefinition/etc., > can I get the actual Type of the field/property/method/etc.?
Am not sure to get what you mean. Do you mean the type declaring the field, property or method? In this case it will simply be: TypeDefinition container = field.DeclaringType; If you mean the type of the field, it's: TypeReference type = field.FieldType Same thing with PropertyType. A method doesn't have a specific type, beside the one it's returning. > 2. I tried using LoadSymbols/SaveSymbols, but doesn't seem to work. I > cannot do debugging after saving the assembly. I've noticed that the > pdb file is drastically modified (has only about 1/3 of its original > size in my specific case) after saving. Am I doing something wrong, or > this is a known issue? I am loading the symbols just after getting the > AssemblyDefinition and save them just before saving the assembly, like > this: > > var assembly = AssemblyFactory.GetAssembly(AssemblyPath); > assembly.MainModule.LoadSymbols(); > // ... > assembly.MainModule.SaveSymbols(); > AssemblyFactory.SaveAssembly(assembly, AssemblyPath); It seems about right, make sure you have Mono.Cecil.Pdb along with Mono.Cecil, and see what VS's debugger says about the debug symbols when it tries to load them. -- Jb Evain <[email protected]> -- -- mono-cecil
