Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.35k stars 4.66k forks source link

Latest nuget packages with ComputeManagementClient returns MissingOrIncorrectVersionHeader for x-ms-version #808

Closed Rowdster closed 9 years ago

Rowdster commented 9 years ago

Hi,

Today, I updated my nuget packages for Microsoft.WindowsAzure.*

The below code no longer works. I cannot use any of the provided client methods. The error is "MissingOrIncorrectVersionHeader: The x-ms-version header value '2014-10-01' is not one of the supported version headers." for the line var results = client.VirtualMachineVMImages.List();

I am uncertain why there is some header version conflict. Do I need to set a specific valid version number? The below code doesn't make any considerations for a version, and I do not know if that is possible.

    private static void TestAzure()
    {
        string subscriptionId = "";
        string base64EncodedCertificate = "";

        X509Certificate2 _azureCertificate = new X509Certificate2(Convert.FromBase64String(base64EncodedCertificate));

        CertificateCloudCredentials ccc = new CertificateCloudCredentials(subscriptionId, _azureCertificate);

        ComputeManagementClient client = new ComputeManagementClient(ccc);

        var results = client.VirtualMachineVMImages.List();

        var hostedServices = client.HostedServices.List();
    }

The package list with versions are here:

Microsoft.Bcl 1.1.9
Microsoft.Bcl.Async 1.0.168
Microsoft.Bcl.Build 1.0.21
Microsoft.Data.Edm 5.6.2
Microsoft.Data.OData 5.6.2
Microsoft.Data.Services.Client 5.6.2
Microsoft.Net.Http 2.2.28
Microsoft.WindowsAzure.Common 1.4.0
Microsoft.WindowsAzure.Comm... 1.1.0
Microsoft.WindowsAzure.Conf... 2.0.3
Microsoft.WindowsAzure.Mana... 2.1.0
Microsoft.WindowsAzure.Mana... 5.1.0
Microsoft.WindowsAzure.Mana... 2.0.0
Microsoft.WindowsAzure.Mana... 2.0.0
Microsoft.WindowsAzure.Mana... 2.0.0
Microsoft.WindowsAzure.Mana... 3.0.0
Microsoft.WindowsAzure.Mana... 3.0.2
Microsoft.WindowsAzure.Mana... 0.14.0-preview
Microsoft.WindowsAzure.Mana... 3.0.0
Microsoft.WindowsAzure.Mana... 3.1.0
Microsoft.WindowsAzure.Mana... 0.9.9-preview
Microsoft.WindowsAzure.Mana... 4.0.0
Newtonsoft.Json 6.0.5
NuGet.CommandLine 2.8.0
NuGet.CommandLine 2.8.2
System.Spatial 5.6.2
WindowsAzure.Storage 4.3.0

huangpf commented 9 years ago

@Rowdster Please refer to #803.

markcowl commented 9 years ago

Fixed with version update