Requirements To Use

Enable System Management capability for your app

Right click Package.appxmanifest > View Code.  In the Capabilities sections add the following line

<iot:Capability Name="systemManagement"/>

If you get a squigle red line "iot not recognised type error" then you need to update the start of the file xmlns as follows (note the 4th xmlns entry-do you have it?  AND the "iot" in IgnorableNamespaces-do you have it?):

IgnorableNamespaces="uap mp iot">
<iot:Capability Name="systemManagement" />

You need to have "Windows IoT Extension for UWP" added to your project

Right click on your project. Then, select Add > Reference.. 

Select Universal Windows > Exensions > Windows IoT Extension for the UWP, select the latest version and press OK


The Visual Studio implementation of this is flakey, a few tips:

Add the iot:Capability just before any DeviceCapabilities if you have them, e.g. this worked for us:

    <Capability Name="internetClient" />
    <Capability Name="internetClientServer" />
    <uap:Capability Name="removableStorage" />
    <iot:Capability Name="systemManagement" />
    <DeviceCapability Name="serialcommunication">
      <Device Id="any">
        <Function Type="name:serialPort" />

Close the Package.appcmanifest and try double clicking it to get the visual designer.  Then re-open it in code view and check everything again – opening in visual mode VS does houekeeping on it and may have changed things like removed your iot from IgnorableNamespace (happened to us!)



	Windows.System.ShutdownManager.BeginShutdown(Windows.System.ShutdownKind.Shutdown, TimeSpan.FromSeconds(1));		//Delay is not relevant to shutdown

	Windows.System.ShutdownManager.BeginShutdown(Windows.System.ShutdownKind.Restart, TimeSpan.FromSeconds(1));		//Delay before restart after shutdown


Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.


Your email address will not be published. Required fields are marked *