{"action":"opened","issue":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/479","labels_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/479/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/479/comments","events_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/479/events","html_url":"https://github.com/Azure/azure-sdk-for-java/issues/479","id":88491106,"number":479,"title":"NullReferenceException when trying to initialize an instance of ComputeManagementClient with an HttpClient","user":{"login":"kcheick","id":244326,"avatar_url":"https://avatars.githubusercontent.com/u/244326?v=3","gravatar_id":"","url":"https://api.github.com/users/kcheick","html_url":"https://github.com/kcheick","followers_url":"https://api.github.com/users/kcheick/followers","following_url":"https://api.github.com/users/kcheick/following{/other_user}","gists_url":"https://api.github.com/users/kcheick/gists{/gist_id}","starred_url":"https://api.github.com/users/kcheick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kcheick/subscriptions","organizations_url":"https://api.github.com/users/kcheick/orgs","repos_url":"https://api.github.com/users/kcheick/repos","events_url":"https://api.github.com/users/kcheick/events{/privacy}","received_events_url":"https://api.github.com/users/kcheick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-15T17:34:15Z","updated_at":"2015-06-15T17:34:15Z","closed_at":null,"body":"the following code throws a NullReferenceException\r\n\r\n```C#\r\n\r\nusing (var messageHandler =  new HttpClientHandler {ClientCertificateOptions = ClientCertificateOption.Automatic })\r\nusing (var httpClient = new HttpClient(messageHandler ))\r\n{\r\n\thttpClient.DefaultRequestHeaders.Add(\"User-Agent\", new []{\"Microsoft.WindowsAzure.Management.Compute.ComputeManagementClient/12.0.0.0\"});\r\n\tusing (var cmc = new Microsoft.WindowsAzure.Management.Compute.ComputeManagementClient( credentials, httpClient)){\r\n\t}\r\n}\r\n```"}}