{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/1017","repository_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/1017/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/1017/comments","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/1017/events","html_url":"https://github.com/Azure/azure-webjobs-sdk-script/issues/1017","id":193020419,"number":1017,"title":"Improve handling of NuGet packages that require assembly binding redirects","user":{"login":"paulbatum","id":10663,"avatar_url":"https://avatars.githubusercontent.com/u/10663?v=3","gravatar_id":"","url":"https://api.github.com/users/paulbatum","html_url":"https://github.com/paulbatum","followers_url":"https://api.github.com/users/paulbatum/followers","following_url":"https://api.github.com/users/paulbatum/following{/other_user}","gists_url":"https://api.github.com/users/paulbatum/gists{/gist_id}","starred_url":"https://api.github.com/users/paulbatum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulbatum/subscriptions","organizations_url":"https://api.github.com/users/paulbatum/orgs","repos_url":"https://api.github.com/users/paulbatum/repos","events_url":"https://api.github.com/users/paulbatum/events{/privacy}","received_events_url":"https://api.github.com/users/paulbatum/received_events","type":"User","site_admin":false},"labels":[{"id":378017356,"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/labels/improvement","name":"improvement","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-02T02:49:39Z","updated_at":"2016-12-03T01:03:27Z","closed_at":null,"body":"The IOT hub client SDK version 1.0.22 requires an assembly binding redirect (this is added automatically when installing the SDK into a console app). However in functions that assembly binding redirect is not applied and it results in an error.\r\n\r\nSteps to reproduce:\r\n\r\n1. Create a function with this code and project.json:\r\n\r\n``` C#\r\nusing System;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing Microsoft.Azure.Devices.Client;  \r\n\r\nprivate const string DeviceConnectionString = \"connection string”;\r\n\r\npublic static void Run(string input, TraceWriter log)\r\n{\r\n                DeviceClient deviceClient = DeviceClient.CreateFromConnectionString(DeviceConnectionString, TransportType.Http1);\r\n                if (deviceClient == null)\r\n                {\r\n                    log.Info($\"Failed to create DeviceClient!\");\r\n                }\r\n                SendEvent(deviceClient,log).Wait();\r\n                log.Info($\"C# End\");\r\n}\r\n\r\nstatic async Task SendEvent(DeviceClient deviceClient, TraceWriter log)\r\n{\r\n    string dataBuffer;\r\n\r\n        dataBuffer = \"Hello world\" + Guid.NewGuid().ToString();\r\n        Message eventMessage = new Message(Encoding.UTF8.GetBytes(dataBuffer));\r\n\r\n        log.Info($\"C# Send message to the device\");\r\n        await deviceClient.SendEventAsync(eventMessage);\r\n\r\n}\r\n```\r\n\r\n\r\n```\r\n{\r\n\"frameworks\": {\r\n    \"net46\":{\r\n        \"dependencies\": {\r\n            \"Microsoft.Azure.Devices.Client\": \"1.0.22\"\r\n                    }\r\n                }\r\n        }\r\n}\r\n```\r\n\r\n2. Paste in an appropriate IOT hub connection string and attempt to run the code\r\n\r\nExpected result: no assembly loading errors occur\r\nActual result: `Exception while executing function: Functions.DevicesTest. mscorlib: Exception has been thrown by the target of an invocation. mscorlib: One or more errors occurred. Microsoft.Azure.Devices.Client: Could not load file or assembly 'Validation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7' or one of its dependencies. The system cannot find the file specified.`"},"comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/comments/264602303","html_url":"https://github.com/Azure/azure-webjobs-sdk-script/issues/1017#issuecomment-264602303","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/1017","id":264602303,"user":{"login":"paulbatum","id":10663,"avatar_url":"https://avatars.githubusercontent.com/u/10663?v=3","gravatar_id":"","url":"https://api.github.com/users/paulbatum","html_url":"https://github.com/paulbatum","followers_url":"https://api.github.com/users/paulbatum/followers","following_url":"https://api.github.com/users/paulbatum/following{/other_user}","gists_url":"https://api.github.com/users/paulbatum/gists{/gist_id}","starred_url":"https://api.github.com/users/paulbatum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulbatum/subscriptions","organizations_url":"https://api.github.com/users/paulbatum/orgs","repos_url":"https://api.github.com/users/paulbatum/repos","events_url":"https://api.github.com/users/paulbatum/events{/privacy}","received_events_url":"https://api.github.com/users/paulbatum/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T01:03:27Z","updated_at":"2016-12-03T01:03:27Z","body":"The experience of debugging this sort of scenario would be improved by https://github.com/Azure/azure-webjobs-sdk-script/issues/1017"}}
{"actor":{"display_login":"paulbatum"}}