An attribute argument must be a constant expression, …- Create an attribute of type array
问题 Here is my custom attribute and a class I\'m using it on: [MethodAttribute(new []{new MethodAttributeMembers(), new MethodAttributeMembers()})] public class JN_Country { } public class MethodAttribute : Attribute { public MethodAttributeMembers[] MethodAttributeMembers { get; set; } public MethodAttribute(MethodAttributeMembers[] methodAttributeMemberses) { MethodAttributeMembers = methodAttributeMemberses; } } public class MethodAttributeMembers { public string MethodName { get; set; }