MSDN Community

Windows IoT Documentation – Services Overview

Welcome to the Windows IoT Services documentation hub. This page provides a comprehensive guide to the services available on Windows IoT Core and Enterprise, including how to configure, deploy, and monitor them.

Available Services

Getting Started

To begin using services on a Windows IoT device, follow the steps below:

# Enable a service (example: DevicePortal)
dism /online /enable-feature /featurename:DevicePortal

# Verify the service status
sc query DevicePortald
        

Sample Code: Starting a Custom Service

Below is a minimal C# template for creating a background service on Windows IoT:

using System;
using System.ServiceProcess;

public class MyIoTService : ServiceBase
{
    public MyIoTService()
    {
        ServiceName = "MyIoTService";
    }

    protected override void OnStart(string[] args)
    {
        // TODO: Add startup code here
        System.Diagnostics.EventLog.WriteEntry(ServiceName, "Service started.");
    }

    protected override void OnStop()
    {
        // TODO: Add cleanup code here
        System.Diagnostics.EventLog.WriteEntry(ServiceName, "Service stopped.");
    }

    public static void Main()
    {
        ServiceBase.Run(new MyIoTService());
    }
}
        

Compile the code using dotnet publish and install it with sc create on the device.

Further Resources

Community Discussion

Alex Turner
Can I enable DevicePortal over HTTPS only?
Mia Lee
Yes, set the DevicePortalSSLPort registry key to 443 and enable the certificate.