static bool HasAttribute(TypeDefinition type, string @namespace, string name) { foreach (var attribute in type.CustomAttributes) { var attribute_type = attribute.AttributeType; if (attribute_type.Name == name && attribute_type.Namespace == @namespace) return true; } return false; }