Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 目前还不知道这样的主机。(来自hresult:0x80072af9的异常)在ARM设备上运行azure设备客户端时发生异常_C#_Azure_Raspberry Pi3_Windows 10 Iot Core_Azure Iot Hub - Fatal编程技术网

C# 目前还不知道这样的主机。(来自hresult:0x80072af9的异常)在ARM设备上运行azure设备客户端时发生异常

C# 目前还不知道这样的主机。(来自hresult:0x80072af9的异常)在ARM设备上运行azure设备客户端时发生异常,c#,azure,raspberry-pi3,windows-10-iot-core,azure-iot-hub,C#,Azure,Raspberry Pi3,Windows 10 Iot Core,Azure Iot Hub,我正在尝试使用下面的代码在Raspberrypi 3设备上运行Microsoft Azure设备客户端。当在本地机器上运行它时,它工作正常,但如果我将它部署到raspberry pi 3设备,它会抛出“不知道这样的主机”(hresult的异常:0x80072af9) 我在raspberry pi设备上运行windows core IOT 10操作系统,并使用Visual studio 2017进行此示例项目。我可以在我的raspberry pi上运行helloblinky之类的示例应用程序

我正在尝试使用下面的代码在Raspberrypi 3设备上运行Microsoft Azure设备客户端。当在本地机器上运行它时,它工作正常,但如果我将它部署到raspberry pi 3设备,它会抛出“不知道这样的主机”(hresult的异常:0x80072af9)

我在raspberry pi设备上运行windows core IOT 10操作系统,并使用Visual studio 2017进行此示例项目。我可以在我的raspberry pi上运行helloblinky之类的示例应用程序

    private static DeviceClient deviceClient = DeviceClient.Create("<myiothub>.azure-devices.net", new DeviceAuthenticationWithRegistrySymmetricKey(<deviceid>, "<secretkey>"), Microsoft.Azure.Devices.Client.TransportType.Amqp);

            while (true)
            {
                try
                {
                    receivedMessage = await deviceClient.ReceiveAsync();
                    if (receivedMessage != null)
                    {
                        messageData = Encoding.ASCII.GetString(receivedMessage.GetBytes());

                        await deviceClient.CompleteAsync(receivedMessage);
                        if (receivedMessage.Properties.ContainsKey("fans"))
                        {
                            GpioPinValue change = receivedMessage.Properties["fans"] == "true" ? GpioPinValue.High : GpioPinValue.Low;
                            pinValue = change;
                            pin.Write(pinValue);
                        }

                    }                 
                }
                catch(Exception ex)
                {

                }
            }
private static DeviceClient DeviceClient=DeviceClient.Create(“.azure devices.net”,新的DeviceAuthenticationWithRegistrySymmetricKey(,”),Microsoft.azure.devices.Client.TransportType.Amqp);
while(true)
{
尝试
{
receivedMessage=await deviceClient.ReceiveAsync();
if(receivedMessage!=null)
{
messageData=Encoding.ASCII.GetString(receivedMessage.GetBytes());
等待设备客户端。完成同步(接收消息);
if(receivedMessage.Properties.ContainsKey(“fans”))
{
GpioPinValue change=receivedMessage.Properties[“fans”]=“true”?GpioPinValue.High:GpioPinValue.Low;
pinValue=变化;
pin.Write(pinValue);
}
}                 
}
捕获(例外情况除外)
{
}
}

你的应用程序是什么类型的,UWP?是的。。我已经创建了UWP。你的物联网核心和桌面windows版本是什么?我使用的是windows物联网核心10版本,我的膝盖上有windows 10。版本号是什么,10.0.15063.483?