Prasanta
Prasanta

Reputation: 11

Restart application in WPF

The problem is that I want to restart my application to upgrade the current application. For this I am using below mentioned two lines of code.

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

Process.GetCurrentProcess().Kill();

OR

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

Application.Current.Shutdown();

But this is giving an error message of "An unhandled win32 exception is occurred". Hence this is not working.

Upvotes: 1

Views: 3806

Answers (1)

Thyago Falconi
Thyago Falconi

Reputation: 91

Have you tried?

Application.Restart();

or

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

Upvotes: 1

Related Questions