I want to download an artifact with Azure DevOps Services API.
While programing with C#, I choose to use Microsoft.TeamFoundationServer.Client
SDK, Version: 16.153.0 as a tool.
I am sure I have the artifact.
But After I use
BuildHttpClient::GetArtifactContentZipAsync(project: "XXX", buildId: buildid, artifactName: "XXX")
to get zip stream. I get exception with a message like :
The requested version \"5.1\" of the resource is under preview. The -preview flag must be supplied in the api-version for such requests. For example: \"5.1-preview\"
It seems I use the wrong version of API, but I really didn't see any API to set this version to "5.1-preview".
Is there a way to solve this problem? Or should I use an older version of TFS SDK?