New Reply

In our CI-system, we use the Proget native API to retrieve information about out NuGet packages, like the latest available version. This mostly works as expected, but we have trouble with NuGet packages whose ID contains underscores ( _ ).

Given the following query, a json structure containing information about the package is returned as expected:

http://<url>/api/json/NuGetPackages_GetLatestStable?Feed_Id=10&PackageIds_Psv=some-package-id&API_Key=<key>

But if the pacakge ID contains an underscore, like the following query, the returned json structure is just an empty list:

http://<url>/api/json/NuGetPackages_GetLatestStable?Feed_Id=10&PackageIds_Psv=some_package_id&API_Key=<key>

We get the same result also for NuGetPackages_GetLatest, so it does not matter if the package exists only in prerelease versions. The result is also the same across different feeds.

Is this a bug in the native API? Are there any possible workarounds for fetching version information for packages whose ID contains an underscore?

Product: ProGet
Version: 4.6.7

I tried with secp256k1_openssl_vc120 and the JSON API works as expected. Is there a specific package name that exhibits this problem that you can share?

We have now also verified that package names that contain underscores work.

When investigating further, we noticed that the packages in question were all added to the feed through a connector. After pulling the package from the connected feed into the feed we query with the API, these also work as expected.

Follow-up question: is this behavior intended? If a package is available in a feed, even if it is through a connector, should it not be queryable?

Seems it was a very unlikely coincidence that all the package IDs with underscores we tested on were added through connectors.

The native API is a database wrapper, and thus would only be able to return local/cached packages.

You should consider using the NuGet API instead.

Answer Details

Preview:

Post Reply