我可以使用 Microsoft.Azure.Devices.RegistryManager 到 add/register IoT Edge 设备吗?

Can I use Microsoft.Azure.Devices.RegistryManager to add/register an IoT Edge device?

尝试搜索 Microsoft 文档,但似乎找不到任何建议我可以使用 RegistryManager.AddDeviceAsync() 将 IoT Edge(预览版)设备添加到 IoT 中心。

MS tutorial 说您可以将 --edge-enabled 选项传递给 CLI 命令 az iot hub device-identity create -d edge001 -n blogDemoHub --edge-enabled 但我如何使用 .NET SDK 执行此操作?

尝试以下操作:

await registryManager.AddDeviceAsync(new Device(deviceId) { Capabilities = new Microsoft.Azure.Devices.Shared.DeviceCapabilities() { IotEdge = true } });