Errore del compilatore CS0104

Aggiornamento: novembre 2007

Messaggio di errore

'riferimento' è un riferimento ambiguo tra 'identificatore' e 'identificatore'.
'reference' is an ambiguous reference between 'identifier' and 'identifier'

Il programma contiene direttive using per due spazi dei nomi e il codice fa riferimento a un nome presente in entrambi gli spazi dei nomi.

Il seguente codice di esempio genera l'errore CS0104:

// CS0104.cs
using x;
using y;

namespace x
{
   public class Test
   {
   }
}

namespace y
{
   public class Test
   {
   }
}

public class a
{
   public static void Main()
   {
      Test test = new Test();   // CS0104, is Test in x or y namespace?
      // try the following line instead
      // y.Test test = new y.Test();
   }
}