A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0104 below:

Compiler Error CS0104 - C#

Compiler Error CS0104

In this article

'reference' is an ambiguous reference between 'identifier' and 'identifier'

Your program contains using directives for two namespaces and your code references a name that appears in both namespaces.

The following sample generates 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();  
   }  
}  

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.

Additional resources

In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4