Compiler Warning (level 2) CS0437
The type 'type' in 'assembly2' conflicts with the imported namespace 'namespace' in 'fassembly1'. Using the type defined in 'assembly'.
This warning is issued when a type in a source file, file_2, conflicts with an imported namespace in file_1. The compiler uses the type in the source file.
// CS0437_a.cs
// compile with: /target:library
namespace Util
{
public class A {
public void Test() {
System.Console.WriteLine("CS0437_a.cs");
}
}
}
The following sample generates CS0437.
// CS0437_b.cs
// compile with: /reference:CS0437_a.dll /W:2
// CS0437 expected
class Util
{
public class A {
public void Test() {
System.Console.WriteLine("CS0437_b.cs");
}
}
}
public class Test
{
public static void Main()
{
Util.A x = new Util.A();
x.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.
.NET feedback
.NET is an open source project. Select a link to provide feedback: