What does it mean when the documentation says that you must specify the app in the system’s metadata before you can retrieve
The SerialNumber property securely retrieves the serial number from the SMBIOS for the system. This property is partial trust, so in a UWP app, you must specify the app in the system’s metadata before retrieving any properties.
OEMs use the SerialNumber property to aid in identification of devices for servicing and troubleshooting operations.
What does it mean when it says that “you must specify the app in the system’s metadata”? How do you do that?
The “you” in that sentence is not talking to you, the software developer. It’s talking to “you” the system manufacturer.
When system manufacturers set up a system, they can specify which apps are permitted to read the serial number. The expectation is that the manufacturers will grant permission to their customer support apps. (That’s what the second paragraph is trying to say.)
For example, if they have an app that provides online help, they can grant that app permission to read your serial number so the app can use it to filter the help results to those that apply to the system you have. System manufacturers are notorious for constantly changing suppliers, so just knowing the model number isn’t always enough to narrow down exactly what hardware is in the system.
What this means for you, the average software developer, is that unless you’ve cut a deal with the system manufacturer, your UWP app won’t be able to read the serial number.
If you want something that can be used from a UWP app to identify the system, you can use the
SystemIdentification class. The
GetSystemIdForPublisher gives you an opaque ID that will be the same for all apps on the system from the same publisher. See the documentation for additional details on how well this value survives reinstalls.