Skip to content
New issue

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

NullReferenceException when trying to initialize an instance of ComputeManagementClient with an HttpClient #1177

Closed
matt-gibbs opened this issue Jun 18, 2015 · 1 comment

Comments

@matt-gibbs
Copy link
Contributor

C# issue filed in the Java repo
Copied over here.
Azure/azure-sdk-for-java#479

using (var messageHandler = new HttpClientHandler {ClientCertificateOptions = ClientCertificateOption.Automatic })
using (var httpClient = new HttpClient(messageHandler ))
{
httpClient.DefaultRequestHeaders.Add("User-Agent", new []{"Microsoft.WindowsAzure.Management.Compute.ComputeManagementClient/12.0.0.0"});
using (var cmc = new Microsoft.WindowsAzure.Management.Compute.ComputeManagementClient( credentials, httpClient)){
}
}

@stankovski
Copy link
Member

@matt-gibbs this has been resolved in the latest version of Azure Client Runtime (https://github.com/Azure/autorest)

azure-sdk pushed a commit that referenced this issue Nov 13, 2020
azure-sdk added a commit that referenced this issue Nov 16, 2020
* Cache created service principal for iteration

Useful when testing changes over and over again without passing your own -TestApplicationId and -TestApplicationSecret.

* Restore initial AzContext for New-TestResources

* Make sure PSBoundParameters is correct

Fixes #1177

Co-authored-by: Heath Stewart <[email protected]>
annelo-msft pushed a commit to annelo-msft/azure-sdk-for-net that referenced this issue Feb 17, 2021
* Cache created service principal for iteration

Useful when testing changes over and over again without passing your own -TestApplicationId and -TestApplicationSecret.

* Restore initial AzContext for New-TestResources

* Make sure PSBoundParameters is correct

Fixes Azure#1177

Co-authored-by: Heath Stewart <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants