Jamey McElveen
Jamey McElveen

Reputation: 18305

How can I perform Application.Restart() in Windows Mobile 6?

I need to restart a windows mobile 6 application.

Here is the code I have tried but it just exits and does not restart the app.

public static void RestartApplication()
{
   var fileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
   var startInfo = new ProcessStartInfo
   {
      FileName = fileName,
   };
   Process.Start(startInfo);
   Application.Exit();
}

Thanks!

Upvotes: 2

Views: 2563

Answers (2)

Peter-Yu
Peter-Yu

Reputation: 191

I tried this code work like a charm on Windows CE 6.

this.Close();
Process.Start(Assembly.GetExecutingAssembly().GetName().CodeBase, "");

It's hard to find a simple way to restart the application on Windows CE on the internet, so I post what I found. I hope this could help somebody to save time.

Upvotes: 0

Related Questions