WPF defines its own Main() method. How should I go about replacing it with my own Main method that (normally) opens the WPF MainWindow
Create new class with your custom static Main method. At the end of this method just call original App.Main() generated by WPF:
public class Program
{
[STAThread]
public static void Main(string[] args)
{
// Your initialization code
App.Main();
}
}
Then set your project’s “Startup object” setting to the class containing your static Main().