Export (0) Print
Expand All
Expand Minimize

Compiler Warning (level 2) CS0435 

Error Message

The namespace 'namespace' in 'file_2' conflicts with the imported type 'type' in 'file_1'. Using the namespace.

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:

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

Then, compile this file:

// 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
   }
}

Community Additions

ADD
Show:
© 2015 Microsoft