Compilerfehler CS0230
Aktualisiert: November 2007
Fehlermeldung
Ein Typ und ein Bezeichner sind in einer foreach-Anweisung erforderlich.
Type and identifier are both required in a foreach statement
Eine foreach-Anweisung ist nicht ordnungsgemäß formuliert.
Im folgenden Beispiel wird CS0230 generiert:
// CS0230.cs
using System;
class MyClass
{
public static void Main()
{
int[] myarray = new int[3] {1,2,3};
foreach (int in myarray) // CS0230
// try the following line instead
// foreach (int x in myarray)
{
Console.WriteLine(x);
}
}
}