Compiler Warning (level 2) CS0436
The type 'type' in 'assembly' conflicts with the imported type 'type2' in 'assembly'. Using the type defined in 'assembly'.
This warning is issued when a type in a source file (file_2) conflicts with an imported type in file_1. The compiler uses the one in the source file.
// CS0436_a.cs
// compile with: /target:library
public class A {
public void Test() {
System.Console.WriteLine("CS0436_a");
}
}
The following example generates CS0436.
// CS0436_b.cs
// compile with: /reference:CS0436_a.dll
// CS0436 expected
public class A {
public void Test() {
System.Console.WriteLine("CS0436_b");
}
}
public class Test
{
public static void Main()
{
A x = new A();
x.Test();
}
}
Compilation produces the following output:
CS0436_b
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.
.NET feedback
.NET is an open source project. Select a link to provide feedback: