Edit

Share via


Compiler Warning (level 2) CS0435

The namespace 'namespace' in 'assembly' conflicts with the imported type 'type' in 'assembly'. Using the namespace defined in 'assembly'.

This warning is issued when a namespace in a source file (file_2) conflicts with an imported type in file_1. The compiler uses the one in the source file.

The following example generates CS0435:

Compile this file first:

C#
// CS0435_1.cs  
// compile with: /t:library  
public class Util
{  
   public class A { }  
}  

Then, compile this file:

C#
// CS0435_2.cs  
// compile with: /r:CS0435_1.dll  
  
using System;  
  
namespace Util
{  
   public class A { }  
}  
  
public class Test
{  
   public static void Main()
   {  
      Console.WriteLine(typeof(Util.A)); // CS0435  
   }  
}