확장 최소화
이 항목은 아직 평가되지 않았습니다.- 이 항목 평가

컴파일러 오류 CS0579

오류 메시지

'attribute' 특성이 중복되었습니다.
Duplicate 'attribute' attribute

같은 특성을 두 번 이상 지정하려면 해당 특성의 AttributeUsage에서 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()
    {
    }
}
이 정보가 도움이 되었습니까?
(1500자 남음)

커뮤니티 추가 항목

추가
© 2013 Microsoft. All rights reserved.