Use platform-specific methods in DeviceId v6
mainIn version 6, instead of calling general methods directly on the builder, use platform-specific wrappers to ensure compatibility and access relevant components. This prevents runtime errors on unsupported platforms.
Common mapping examples:
| v5 Method | v6 Windows | v6 Linux | v6 Mac |
|---|---|---|---|
AddOSInstallationID() | .OnWindows(x => x.AddMachineGuid()) | .OnLinux(x => x.AddMachineId()) | .OnMac(x => x.AddPlatformSerialNumber()) |
AddMotherboardSerialNumber() | .OnWindows(x => x.AddMotherboardSerialNumber()) | .OnLinux(x => x.AddMotherboardSerialNumber()) | Not available |
AddSystemUUID() | .OnWindows(x => x.AddSystemUuid()) | .OnLinux(x => x.AddProductUuid()) | Not available |
AddSystemUUID() (as Processor ID) | .OnWindows(x => x.AddProcessorId()) | .OnLinux(x => x.AddCpuInfo()) | Not available |
// Example of platform-specific component selection in v6
builder.OnWindows(x => x.AddMachineGuid())
.OnLinux(x => x.AddMachineId())
.OnMac(x => x.AddPlatformSerialNumber());