Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'arg' duplicate named attribute argument
A parameter, arg, on a user-defined attribute was specified twice. For more information, see Attributes (C# Programming Guide).
Example
The following sample generates 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 ()
{
}
}