Sdílet prostřednictvím


Compilerfehler CS0186

Aktualisiert: November 2007

Fehlermeldung

Die Verwendung von NULL ist in diesem Kontext ungültig.
Use of null is not valid in this context

Im folgenden Beispiel wird CS0186 generiert:

// CS0186.cs
using System;
using System.Collections;

class MyClass 
{
   static void Main() 
   {
      // Each of the following lines generates CS0186:
      foreach (int i in null) {}   // CS0186
      foreach (int i in (IEnumerable) null) { };   // CS0186
   }
}