public void AddBabelName(MethodBuilder methodBuilder, string babelName) { Type[] paramTypes = new Type[] { typeof(string) }; ConstructorInfo constructor = typeof(BabelNameAttribute).GetConstructor(paramTypes); CustomAttributeBuilder attrBuilder = new CustomAttributeBuilder(constructor, new object[] { babelName }); methodBuilder.SetCustomAttribute(attrBuilder); Attribute attr = new BabelNameAttribute(babelName); AddCustomAttribute(methodBuilder, attr); }