JJ Liu
JJ Liu

Reputation: 1421

Application.Restart() does not close the old one, but start a new one

C# WPF application, Kinect Application

Called from a Page, wanted to restart the whole application

System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath);
System.Windows.Forms.Application.Exit();

Also does not close the old one. Why is it? Any hack I can do? This is kind last-minute so I need a hack solution because I am going to demo in an hour.

Thanks.

Upvotes: 0

Views: 418

Answers (1)

ali.alikhani
ali.alikhani

Reputation: 185

You Can Use This. This Work On Wpf

System.Diagnostics.Process.Start(Environment.CurrentDirectory+"\\YourExeName");
Close();

Upvotes: 1

Related Questions