private bool LoadAllAttributesIntoMemory(ModuleDefinition module) { // touching the customattributes constructor args causes resolving -> update of references. if (module.Assembly != null) foreach (var customAttribute in module.Assembly.CustomAttributes) TouchArguments (customAttribute); foreach (var customAttribute in module.CustomAttributes) TouchArguments (customAttribute); foreach (var type in module.LoadAllTypes ()) { foreach (var customAttribute in type.CustomAttributes) TouchArguments (customAttribute); foreach (var fieldDefinition in type.Fields) foreach (var customAttribute in fieldDefinition.CustomAttributes) TouchArguments (customAttribute); foreach (var eventDefinition in type.Events) foreach (var customAttribute in eventDefinition.CustomAttributes) TouchArguments (customAttribute); foreach (var genericParameter in type.GenericParameters) foreach (var customAttribute in genericParameter.CustomAttributes) TouchArguments (customAttribute); foreach (var methodDefinition in type.Methods) { foreach (var customAttribute in methodDefinition.CustomAttributes) TouchArguments (customAttribute); foreach (var parameterDefinition in methodDefinition.Parameters) foreach (var customAttribute in parameterDefinition.CustomAttributes) TouchArguments (customAttribute); } } return true; }