Delete the existing App.xaml file and write a new class file(lets call it StartUp.cs) that looks like below:
public class StartUp : Application
{
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static void Main()
{
StartUp app = new StartUp();
app.InitializeComponent();
app.Run();
}
public void InitializeComponent()
{
this.StartupUri = new Uri("MainWindow.xaml", System.UriKind.Relative);
}
}
Note that this class inherits System.Windows.Application
public class StartUp : Application
{
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static void Main()
{
StartUp app = new StartUp();
app.InitializeComponent();
app.Run();
}
public void InitializeComponent()
{
this.StartupUri = new Uri("MainWindow.xaml", System.UriKind.Relative);
}
}
Note that this class inherits System.Windows.Application