{"action":"created","issue":{"url":"https://api.github.com/repos/JoeMayo/LinqToTwitter/issues/118","repository_url":"https://api.github.com/repos/JoeMayo/LinqToTwitter","labels_url":"https://api.github.com/repos/JoeMayo/LinqToTwitter/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/JoeMayo/LinqToTwitter/issues/118/comments","events_url":"https://api.github.com/repos/JoeMayo/LinqToTwitter/issues/118/events","html_url":"https://github.com/JoeMayo/LinqToTwitter/issues/118","id":307421443,"number":118,"title":"Error in production","user":{"login":"kshitijsharmanet","id":37638335,"avatar_url":"https://avatars3.githubusercontent.com/u/37638335?v=4","gravatar_id":"","url":"https://api.github.com/users/kshitijsharmanet","html_url":"https://github.com/kshitijsharmanet","followers_url":"https://api.github.com/users/kshitijsharmanet/followers","following_url":"https://api.github.com/users/kshitijsharmanet/following{/other_user}","gists_url":"https://api.github.com/users/kshitijsharmanet/gists{/gist_id}","starred_url":"https://api.github.com/users/kshitijsharmanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kshitijsharmanet/subscriptions","organizations_url":"https://api.github.com/users/kshitijsharmanet/orgs","repos_url":"https://api.github.com/users/kshitijsharmanet/repos","events_url":"https://api.github.com/users/kshitijsharmanet/events{/privacy}","received_events_url":"https://api.github.com/users/kshitijsharmanet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-03-21T21:17:48Z","updated_at":"2018-03-24T21:10:33Z","closed_at":null,"author_association":"NONE","body":"Hello, \r\n\r\nI am trying to use below code to post media to twitter using linq2twitter\r\n\r\n    //{\r\n            _logger.LogInformation(\"Starting ProcessUploadTwitter\");\r\n            var auth = new SingleUserAuthorizer\r\n            {\r\n\r\n                CredentialStore = new InMemoryCredentialStore()\r\n                {\r\n\r\n                    ConsumerKey = oauth.ApiKey,\r\n                    ConsumerSecret = oauth.ApiSecret,\r\n                    OAuthToken = oauth.ApplicationToken,\r\n                    OAuthTokenSecret = oauth.ApplicationTokenSecret\r\n\r\n                }\r\n\r\n            };\r\n            var twitterCtx = new TwitterContext(auth);\r\n            string mediaCategory = \"tweet_image\";\r\n            _logger.LogInformation(\"TWEETING FILE= \" + file);\r\n            var imageUploadTasks =\r\n           new List<Task<Media>>\r\n           {\r\n                    twitterCtx.UploadMediaAsync(System.IO.File.ReadAllBytes(file), \"image/jpg\", mediaCategory),\r\n           };\r\n            _logger.LogInformation(\"MEDIA UPLOADED TO TWEETER- WAITING TO TWEET THE MEDIA\");\r\n            await Task.WhenAll(imageUploadTasks);\r\n            List<ulong> mediaIds =\r\n            (from tsk in imageUploadTasks\r\n             select tsk.Result.MediaID)\r\n            .ToList();\r\n\r\n\r\n            Status tweet = await twitterCtx.TweetAsync(tenant.Domain, mediaIds);\r\n            _logger.LogInformation(\"MEDIA TWEETED\");\r\n        \r\n\r\nIt works fine in dev (locally) but in production I am getting below err:\r\n\r\n502 - Web server received an invalid response while acting as a gateway or proxy server.\r\n\r\nWhat could be the reason?"},"comment":{"url":"https://api.github.com/repos/JoeMayo/LinqToTwitter/issues/comments/375925175","html_url":"https://github.com/JoeMayo/LinqToTwitter/issues/118#issuecomment-375925175","issue_url":"https://api.github.com/repos/JoeMayo/LinqToTwitter/issues/118","id":375925175,"user":{"login":"kshitijsharmanet","id":37638335,"avatar_url":"https://avatars3.githubusercontent.com/u/37638335?v=4","gravatar_id":"","url":"https://api.github.com/users/kshitijsharmanet","html_url":"https://github.com/kshitijsharmanet","followers_url":"https://api.github.com/users/kshitijsharmanet/followers","following_url":"https://api.github.com/users/kshitijsharmanet/following{/other_user}","gists_url":"https://api.github.com/users/kshitijsharmanet/gists{/gist_id}","starred_url":"https://api.github.com/users/kshitijsharmanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kshitijsharmanet/subscriptions","organizations_url":"https://api.github.com/users/kshitijsharmanet/orgs","repos_url":"https://api.github.com/users/kshitijsharmanet/repos","events_url":"https://api.github.com/users/kshitijsharmanet/events{/privacy}","received_events_url":"https://api.github.com/users/kshitijsharmanet/received_events","type":"User","site_admin":false},"created_at":"2018-03-24T21:10:33Z","updated_at":"2018-03-24T21:10:33Z","author_association":"NONE","body":"Thanks for the pointer. I was able to log the exception:\r\n\r\n2018-03-25T02:16:24.1703562+05:30 [INF] UnhandledException Has been Caught : Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (a086bf64)\r\n\r\n"}}
{"actor":{"display_login":"kshitijsharmanet"}}