Compilerfehler CS0674
Aktualisiert: November 2007
Fehlermeldung
Verwenden Sie nicht System.ParamArrayAttribute, sondern das params-Schlüsselwort.
Do not use 'System.ParamArrayAttribute'. Use the 'params' keyword instead.
Die Verwendung von System.ParamArrayAttribute wird vom C#-Compiler nicht unterstützt. Verwenden Sie stattdessen params.
Im folgenden Beispiel wird CS0674 generiert:
// CS0674.cs
using System;
public class MyClass
{
public static void UseParams([ParamArray] int[] list) // CS0674
// try the following line instead
// public static void UseParams(params int[] list)
{
for ( int i = 0 ; i < list.Length ; i++ )
Console.WriteLine(list[i]);
Console.WriteLine();
}
public static void Main()
{
UseParams(1, 2, 3);
}
}