I am trying to fix warning
Warning CS0436: The type 'Class1' in '...\SharedProject1\SharedProject1\Class1.cs' conflicts with the imported type 'Class1' in 'ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in '...\SharedProject1\SharedProject1\Class1.cs'. WpfApplication1 ...\SharedProject1\WpfApplication1\MainWindow.xaml.cs
Repro:
- create solution with 3 projects:
SharedProject1 (add new class to it)
namespace SharedProject1
{
public class Class1() { }
}
ClassLibrary1
namespace ClassLibrary1
{
public class Class1 { }
}
WpfApplication1 (add this to MainWindow
constructor)
public MainWindow()
{
InitializeComponent();
var a = new SharedProject1.Class1();
var b = new ClassLibrary1.Class1();
}
reference
SharedProject1
in bothClassLibrary1
andWpfApplication1
;build, you will get a warning.
Question: how to fix the warning?