Search code examples
c#uwpiotwindows-10-iot-corewindowsiot

How to relaunch a Windows 10 IoT app programmatically


I have a Windows 10 IoT app developed in C#, and I need to relaunch the app when the configuration has changed. How can the app relaunch itself programmatically?


Solution

  • Base on the Richard's comments I have resolved as follows:

    1. I set my application as the default application (see picture)
    2. When I need to relaunch the app, simply close it and the operating system opens again.

    Setting the default app How to set the default app

    The code for close the app is:

    private void Exit()
    {
       Windows.ApplicationModel.Core.CoreApplication.Exit();
    }