{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-csharp/issues/213","repository_url":"https://api.github.com/repos/Azure/azure-iot-sdk-csharp","labels_url":"https://api.github.com/repos/Azure/azure-iot-sdk-csharp/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-csharp/issues/213/comments","events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-csharp/issues/213/events","html_url":"https://github.com/Azure/azure-iot-sdk-csharp/issues/213","id":270322241,"number":213,"title":"Exception thrown when calling RegistryManager.GetTwinAsync()","user":{"login":"andyce1010","id":10951578,"avatar_url":"https://avatars2.githubusercontent.com/u/10951578?v=4","gravatar_id":"","url":"https://api.github.com/users/andyce1010","html_url":"https://github.com/andyce1010","followers_url":"https://api.github.com/users/andyce1010/followers","following_url":"https://api.github.com/users/andyce1010/following{/other_user}","gists_url":"https://api.github.com/users/andyce1010/gists{/gist_id}","starred_url":"https://api.github.com/users/andyce1010/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyce1010/subscriptions","organizations_url":"https://api.github.com/users/andyce1010/orgs","repos_url":"https://api.github.com/users/andyce1010/repos","events_url":"https://api.github.com/users/andyce1010/events{/privacy}","received_events_url":"https://api.github.com/users/andyce1010/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-01T14:15:37Z","updated_at":"2017-11-02T18:29:22Z","closed_at":null,"author_association":"NONE","body":"OS and version used:  Windows 10 Pro\r\nSDK version used: \r\nMicrosoft.Azure.Devices 1.4.1 \r\n.NET Core 2.0\r\n\r\nDescription of the issue:\r\nAny calls to RegistryManager.GetTwinAsync(\"deviceId\") seem to result in a JsonSerializationException being thrown.\r\nThis seems to have suddenly started happening today, so I not sure what has changed.\r\n\r\nI've have created a simple .NET core console app to reproduce the issue (see code below), and I get the same error.  \r\n\r\nI also created a full framework console app, and that one works with out issue. So it must be related to .NET Core somehow.\r\n\r\n# Code sample exhibiting the issue:\r\n\r\n        static void Main(string[] args)\r\n        {\r\n            var man = RegistryManager.CreateFromConnectionString(\"xxxxxxx\");\r\n\r\n            var twin = man.GetTwinAsync(\"xxxxx\").Result;\r\n        }\r\n\r\n# Console log of the issue:\r\n\r\nSystem.AggregateException occurred\r\n  HResult=0x80131500\r\n  Message=One or more errors occurred. (Additional text found in JSON string after finishing deserializing object. Path '', line 1, position 272.)\r\n  Source=System.Private.CoreLib\r\n  StackTrace:\r\n   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\r\n   at ConsoleApp2.Program.Main(String[] args) in C:\\dev\\ConsoleApp2\\Program.cs:line 12\r\n\r\nInner Exception 1:\r\nIotHubException: Additional text found in JSON string after finishing deserializing object. Path '', line 1, position 272.\r\n\r\nInner Exception 2:\r\nJsonSerializationException: Additional text found in JSON string after finishing deserializing object. Path '', line 1, position 272.\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-csharp/issues/comments/341516646","html_url":"https://github.com/Azure/azure-iot-sdk-csharp/issues/213#issuecomment-341516646","issue_url":"https://api.github.com/repos/Azure/azure-iot-sdk-csharp/issues/213","id":341516646,"user":{"login":"jasmineymlo","id":19498625,"avatar_url":"https://avatars3.githubusercontent.com/u/19498625?v=4","gravatar_id":"","url":"https://api.github.com/users/jasmineymlo","html_url":"https://github.com/jasmineymlo","followers_url":"https://api.github.com/users/jasmineymlo/followers","following_url":"https://api.github.com/users/jasmineymlo/following{/other_user}","gists_url":"https://api.github.com/users/jasmineymlo/gists{/gist_id}","starred_url":"https://api.github.com/users/jasmineymlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasmineymlo/subscriptions","organizations_url":"https://api.github.com/users/jasmineymlo/orgs","repos_url":"https://api.github.com/users/jasmineymlo/repos","events_url":"https://api.github.com/users/jasmineymlo/events{/privacy}","received_events_url":"https://api.github.com/users/jasmineymlo/received_events","type":"User","site_admin":false},"created_at":"2017-11-02T18:29:22Z","updated_at":"2017-11-02T18:29:22Z","author_association":"CONTRIBUTOR","body":"This is a known issue. It only affects .Net standard and core clients. We are in the process of fixing this on the service side.  Until then a workaround is to call the following before the call to GetTwinAsync:\r\n\r\n JsonConvert.DefaultSettings = () => new JsonSerializerSettings\r\n    {\r\n        CheckAdditionalContent = false\r\n    };\r\n\r\nThanks.\r\n"}}
{"actor":{"display_login":"jasmineymlo"}}