Reputation: 2940
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?
Upvotes: 6
Views: 1971
Reputation: 122
Have you tried using powershell right after a configuration deployment to restart it? https://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
the command
net start 'program'
should be what you're looking for in powershell
For the Device: Since IoT only allows 1 app at a time, have you considered just issuing the device itself a the restart command and the application to go on startup
Upvotes: 2
Reputation: 2940
Base on the Richard's comments I have resolved as follows:
The code for close the app is:
private void Exit()
{
Windows.ApplicationModel.Core.CoreApplication.Exit();
}
Upvotes: 6