question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ArgumentNullException for autocompleteUrl using Azure Artifacts feed

See original GitHub issue

When using NuGetClient with an Azure Artifacts feed, calling GetPackageMetadataAsync throws an ArgumentNullException for autocompleteUrl.

To Reproduce

  1. Create a public Azure Artifacts NuGet feed. I have an empty one at https://pkgs.dev.azure.com/mysqlnet/MySqlConnector/_packaging/test/nuget/v3/index.json
  2. Install BaGet.Protocol 0.3.0-preview2
  3. Run this code:
var client = new NuGetClient("https://pkgs.dev.azure.com/mysqlnet/MySqlConnector/_packaging/test/nuget/v3/index.json");
await client.GetPackageMetadataAsync("Test");
  1. There’s an unhandled exception:
ArgumentNullException: Value cannot be null. (Parameter 'autocompleteUrl')
   at BaGet.Protocol.Internal.RawSearchClient..ctor(HttpClient httpClient, String searchUrl, String autocompleteUrl) in D:\a\1\s\src\BaGet.Protocol\Search\RawSearchClient.cs:line 33
   at BaGet.Protocol.NuGetClientFactory.GetAsync[T](Func`2 clientFactory, CancellationToken cancellationToken) in D:\a\1\s\src\BaGet.Protocol\NuGetClientFactory.cs:line 151
   at BaGet.Protocol.NuGetClientFactory.PackageMetadataClient.GetRegistrationIndexOrNullAsync(String packageId, CancellationToken cancellationToken) in D:\a\1\s\src\BaGet.Protocol\PackageMetadata\PackageMetadataClient.cs:line 24
   at BaGet.Protocol.NuGetClient.GetPackageMetadataAsync(String packageId, CancellationToken cancellationToken) in D:\a\1\s\src\BaGet.Protocol\NuGetClient.cs:line 200

Expected behavior

That BaGet.Protocol should be able to retrieve package metadata from Azure Artifacts, even if all NuGet API v3 services aren’t exposed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bgraingercommented, Feb 16, 2020

Confirmed that preview3 works great; thanks!

1reaction
loic-sharmacommented, Feb 15, 2020

Thanks for reporting! I’ll do two fixes:

  1. The autocomplete resource isn’t required (see this), BaGet.Protocol shouldn’t assume it exists
  2. BaGet.Protocol should throw a better exception if it cannot find an expected resource
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot push packages to azure artifacts feed, keeps ...
I've been pushing packages before but for some reason it now stops working. I've got a feed setup and I got full owner...
Read more >
Configure permissions - Azure Artifacts
How to configure permissions for Artifacts feeds, views, and pipelines access.
Read more >
Get started with NuGet packages and Azure Artifacts
Azure Artifacts enables developers to publish and download NuGet packages from different sources such as feeds and public registries.
Read more >
Migrate from file shares - Azure Artifacts
How to migrate from file shares to Azure Artifacts. ... Azure Artifacts maintains an index of packages within each feed, allowing for quick ......
Read more >
Publish & download Universal Packages - Azure Pipelines
The Universal Packages task in Azure Pipelines is set to use $(Build.ArtifactStagingDirectory) as the default publish directory.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found