We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message: Microsoft.Azure.Devices.Common.Exceptions.IotHubException : Error converting value 1/1/0001 12:00:00 AM +00:00 to type 'System.DateTime'. Path 'statusUpdateTime', line 1, position 142. ----> Newtonsoft.Json.JsonSerializationException : Error converting value 1/1/0001 12:00:00 AM +00:00 to type 'System.DateTime'. Path 'statusUpdateTime', line 1, position 142. ----> System.InvalidCastException : Object must implement IConvertible. Stack Trace: HttpClientHelper.ExecuteAsync(HttpClient httpClient, HttpMethod httpMethod, Uri requestUri, Func3 modifyRequestMessageAsync, Func2 isMappedToException, Func3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) HttpClientHelper.GetAsync[T](Uri requestUri, TimeSpan operationTimeout, IDictionary2 errorMappingOverrides, IDictionary2 customHeaders, Boolean throwIfNotFound, CancellationToken cancellationToken) AzureIoTUtils.GetTwinAsync(String deviceId) line 41 AzureIoTUtilsTests.TestGetTwinAsync(String deviceId) line 33 GenericAdapter1.BlockUntilCompleted() NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaitable) AsyncToSyncAdapter.Await(Func1 invoke) TestMethodCommand.RunTestMethod(TestExecutionContext context) TestMethodCommand.Execute(TestExecutionContext context) SimpleWorkItem.PerformWork() --JsonSerializationException JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) JsonSerializerProxy.DeserializeInternal(JsonReader reader, Type objectType) JsonSerializer.Deserialize(JsonReader reader, Type objectType) JsonSerializer.Deserialize[T](JsonReader reader) TwinJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) JsonSerializer.Deserialize(JsonReader reader, Type objectType) JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) JsonConvert.DeserializeObject[T](String value) HttpClientHelper.ReadResponseMessageAsync[T](HttpResponseMessage message, CancellationToken token) <b__9>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- HttpClientHelper.ExecuteAsync(HttpClient httpClient, HttpMethod httpMethod, Uri requestUri, Func3 modifyRequestMessageAsync, Func2 isMappedToException, Func3 processResponseMessageAsync, IDictionary2 errorMappingOverrides, CancellationToken cancellationToken) --InvalidCastException Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
3 modifyRequestMessageAsync, Func
3 processResponseMessageAsync, IDictionary
2 errorMappingOverrides, IDictionary
1.BlockUntilCompleted() NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaitable) AsyncToSyncAdapter.Await(Func
The text was updated successfully, but these errors were encountered:
Thank you for reporting this. Could you also share the scenario and steps to reproduce this issue?
Sorry, something went wrong.
Just set default JsonSerializerSettings.DateParseHandling to DateParseHandling.DateTimeOffset
@abhipsaMisra, @hanabi1224, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey
abhipsaMisra
Successfully merging a pull request may close this issue.
Message:
Microsoft.Azure.Devices.Common.Exceptions.IotHubException : Error converting value 1/1/0001 12:00:00 AM +00:00 to type 'System.DateTime'. Path 'statusUpdateTime', line 1, position 142.
----> Newtonsoft.Json.JsonSerializationException : Error converting value 1/1/0001 12:00:00 AM +00:00 to type 'System.DateTime'. Path 'statusUpdateTime', line 1, position 142.
----> System.InvalidCastException : Object must implement IConvertible.
Stack Trace:
HttpClientHelper.ExecuteAsync(HttpClient httpClient, HttpMethod httpMethod, Uri requestUri, Func
3 modifyRequestMessageAsync, Func
2 isMappedToException, Func3 processResponseMessageAsync, IDictionary
2 errorMappingOverrides, CancellationToken cancellationToken)HttpClientHelper.GetAsync[T](Uri requestUri, TimeSpan operationTimeout, IDictionary
2 errorMappingOverrides, IDictionary
2 customHeaders, Boolean throwIfNotFound, CancellationToken cancellationToken)AzureIoTUtils.GetTwinAsync(String deviceId) line 41
AzureIoTUtilsTests.TestGetTwinAsync(String deviceId) line 33
GenericAdapter
1.BlockUntilCompleted() NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaitable) AsyncToSyncAdapter.Await(Func
1 invoke)TestMethodCommand.RunTestMethod(TestExecutionContext context)
TestMethodCommand.Execute(TestExecutionContext context)
SimpleWorkItem.PerformWork()
--JsonSerializationException
JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
JsonSerializerProxy.DeserializeInternal(JsonReader reader, Type objectType)
JsonSerializer.Deserialize(JsonReader reader, Type objectType)
JsonSerializer.Deserialize[T](JsonReader reader)
TwinJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
JsonSerializer.Deserialize(JsonReader reader, Type objectType)
JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
JsonConvert.DeserializeObject[T](String value)
HttpClientHelper.ReadResponseMessageAsync[T](HttpResponseMessage message, CancellationToken token)
<b__9>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
HttpClientHelper.ExecuteAsync(HttpClient httpClient, HttpMethod httpMethod, Uri requestUri, Func
3 modifyRequestMessageAsync, Func
2 isMappedToException, Func3 processResponseMessageAsync, IDictionary
2 errorMappingOverrides, CancellationToken cancellationToken)--InvalidCastException
Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
The text was updated successfully, but these errors were encountered: