WindowsAppSDK: Restart API not working with unpackaged apps in 1.1.3

Describe the bug

Official documents https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/stable-channel#app-lifecycle--restart mention this should work for packaged and unpackaged apps, but using Microsoft.Windows.AppLifecycle.AppInstance.Restart(""); as described here https://github.com/microsoft/WindowsAppSDK/blob/main/specs/AppLifecycle/Restart/restartApi.markdown#new-api just crashes the app.

Steps to reproduce the bug

Just use this sample to verify: TestRestartManager.zip

Expected behavior

No response

Screenshots

No response

NuGet package version

1.1.3

Packaging type

Unpackaged

Windows version

Windows 10 version 21H2 (19044, November 2021 Update)

IDE

Visual Studio 2022

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (8 by maintainers)

Most upvoted comments

The issue with RestartAgent.exe not being included in selfcontained apps is fixed in 1.4 preview 2.

The ACLs are being changed and should be serviced in February.

Alrighty. Updating this. Sorry it took so long. The bug was deeper than I though.

This is a platform issue in VB. The ACLs on the folder in Windows Apps is Low IL. What this means is, even if the parent app is medium-IL, any process made in the frameworks folder, for example, RestartAgent.exe, “…\windowsapps[Fwp]\RestartAgent.exe” is lowIL.

Since restartAgent.exe creates the same process that was restarted, and, new processes inherit the parent processes IL, that means, the new process is also LowIL.

Now I’ll be talking with peeps to figure out “What do we do about this and how do we fix it.”

Again, sorry this is taking so long. I’m still working on it though.