AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
# Compiler Error CS0579 重复“attribute”特性 不可能多次指定相同的特性,除非特性在其 [AttributeUsage](https://msdn.microsoft.com/zh-cn/library/tw5zxet9.aspx) 中指定 **AllowMultiple=true**。 下面的示例会产生 CS0579。 ``` // CS0579.cs using System; public class MyAttribute : Attribute { } [AttributeUsage(AttributeTargets.All,AllowMultiple=true)] public class MyAttribute2 : Attribute { } public class z { [MyAttribute, MyAttribute] // CS0579 public void zz() { } [MyAttribute2, MyAttribute2] // OK public void zzz() { } public static void Main() { } } ```