Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 479.6k

System.ArgumentNullException: 'Value cannot be null. Paramet

Sep 9 2019 7:51 AM
Hi Team
 
I have this error System.ArgumentNullException:Value cannot be null, Parameter name:connectionString.
 
 
private static string s_deviceConnectionString = Environment.GetEnvironmentVariable("IOTHUB_DEVICE-CONN_STRING"); 
 
launchSetting.json
 
{
"profiles": {
"TwinDeviceApplication": {
"commandName": "eNtsaIOTHubs",
"environmentVariables": {
"IOTHUB_DEVICE-CONN_STRING": "HostName=eNtsaIOTHubs.azure-devices.net;DeviceId=eNtsaDeviceId;SharedAccessKey=***
}
}
}
}
 
DeviceClient deviceClient = DeviceClient.CreateFromConnectionString(s_deviceClientConnectionString, s_ transportType);
 
 What am i missing? Isnt my deviceClient object has to launch this setting.json file to createConnectionString? Please assist me, thanks.

Answers (4)