Search code examples
c#wpf

Restart application using C#


How can I restart my WPF application using C#?


Solution

  • I don't think there's a direct method in WPF like there is in WinForms. However, you could use methods from the Windowns.Form namespace like this: (You might need to add a reference to the System.Windows.Form assembly)

    System.Windows.Forms.Application.Restart();
    
    System.Windows.Application.Current.Shutdown();