Hello,
Welcome to Microsoft Q&A!
It seems that you are trying to use ShutdownManager Class to shut down your device. You need to add the systemManagement capability instead of shutdown
. All the available capabilities are listed here: App capability declarations.
If you need to add the systemManagement capability, the "iot" namespace needs to be added to the manifest of your UWP app first. Then add it to the IgnorableNamespaces list.
<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" />
<iot:Capability Name="systemManagement"/>
</Capabilities>
</Package>
As you could see, this capability belongs to IOT namespace. The shundown method in the ShutdownManager Class only applicable to IOT device, such as raspberry pie with iot specific OS. And it will not work for Windows 10 Pro tablet, if you do want to shut down device, we suggest you use desktop bridge to make desktop extension for uwp app and shut down computer with Win32 api Process.Start("shutdown", "/s /f /t 0");.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.