I have UWP application running at kiosk mode in Tablet with Window 10. I would like to restart Tablet from my app. My installed UWP SDK version is - 10.0.18362.0. So I added into manifest:
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10"
IgnorableNamespaces="uap mp iot">
<Capabilities>
<Capability Name="internetClient" />
<!-- Add the capability here -->
<iot:Capability Name="systemManagement" />
<DeviceCapability Name="wifiControl" />
<DeviceCapability Name="bluetooth" />
And try to restart system in button event handler:
private async void OnClick(object sender, RoutedEventArgs e)
{
await Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
{
ShutdownManager.BeginShutdown(ShutdownKind.Restart, TimeSpan.FromSeconds(3));
});
}
And I get the error:
System.UnauthorizedAccessException - (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
There is my extensions:
I couldn't find Windows IoT Extension there. Maybe this is the reason? How can I restart my tablet programmably.
UPD: I installed SDK with IoT Extension and added reference it does't help.