Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I restart a WPF application? [duplicate]

How can I restart a WPF Application? In windows Forms I used

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

How to do it in WPF?

like image 382
Hooch Avatar asked Jan 23 '11 11:01

Hooch


2 Answers

I found this: It works. But. Is there any better way?

System.Diagnostics.Process.Start(Application.ResourceAssembly.Location); Application.Current.Shutdown(); 
like image 129
Hooch Avatar answered Sep 22 '22 05:09

Hooch


I've used this in WPF, successfully:

System.Windows.Forms.Application.Restart(); System.Windows.Application.Current.Shutdown(); 
like image 33
epalm Avatar answered Sep 18 '22 05:09

epalm