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?
Asked
Active
Viewed 1,930 times
2 Answers
6
Base on the Richard's comments I have resolved as follows:
- I set my application as the default application (see picture)
- When I need to relaunch the app, simply close it and the operating system opens again.
The code for close the app is:
private void Exit()
{
Windows.ApplicationModel.Core.CoreApplication.Exit();
}

Community
- 1
- 1

Juan Carlos Velez
- 2,840
- 2
- 34
- 48
2
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

Richard
- 122
- 12
-
I need the application itself automatically relauch, but your solution is for I relaunch from the pc. – Juan Carlos Velez Dec 09 '15 at 12:56
-
Just to clarify on the question before I edit the answer, you need to restart the app when the configuration has changed due to user input on the device? – Richard Dec 09 '15 at 14:15
-
Yes, you are right. The app must to restart when the configuration has changed due to user input on the device. – Juan Carlos Velez Dec 09 '15 at 15:50
-
Since IoT only allows 1 app, have you considered just issuing the device itself a the restart command and the application to just go on startup? – Richard Dec 09 '15 at 19:01
-
I've edited this answer to include your specific circumstance (for future readers). Happy coding! – Richard Dec 15 '15 at 19:18