简体   繁体   中英

An unhandled exception of type 'System.FormatException' occurred in Microsoft.Azure.Devices.dll

I'm referring this tutorial to create a device identity. However, getting an exception as below:

在此处输入图片说明

Here is my config file:

在此处输入图片说明

Edit:
What is this Instrumentation key and value in App.Config? I just copied from the sample code. However, from where can I get it, in case I'm using a real device?

Am I missing any SDK or anything else? Do I need to download something extra? the tutorial does not suggest anything. Even when I'm running sample code from GiTHub getting the same error.

the following screen snippet shows a reason of this error, such as connectionString .

错误

Use the connectionString from your Azure IoT Hub - see the tutorial section Create an IoT Hub step 6.

Can you check that the connection string you're using is in the correct format. It should look like:

"HostName={your hub name}.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey={your key}"

You can copy the complete connection string from the portal as described in the tutorial.

Issue resolve: I was missing my connection string.Which I got from "IoTHubOwner" from Azure portal login. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM