Share via


컴파일러 오류 CS0643

업데이트: 2007년 11월

오류 메시지

'arg'은(는) 중복 명명된 특성 인수입니다.
'arg' duplicate named attribute argument

사용자 정의 특성에 매개 변수 arg를 두 번 지정했습니다. 자세한 내용은 특성(C# 프로그래밍 가이드)를 참조하십시오.

예제

다음 샘플에서는 CS0643 오류가 발생하는 경우를 보여 줍니다.

// CS0643.cs
using System;
using System.Runtime.InteropServices;

[AttributeUsage(AttributeTargets.Class)]
public class MyAttribute : Attribute
{
    public MyAttribute()
    {
    }

    public int x;
}

[MyAttribute(x = 5, x = 6)]   // CS0643, error setting x twice
// try the following line instead
// [MyAttribute(x = 5)]
class MyClass
{
}

public class MainClass
{
    public static void Main ()
    {
    }
}