Open RoBit666 opened 2 months ago
Hi. I am using Artifactory and I don't have any issues with the Updates. You configuration seems ok. For each installed package updates should be fetched using a link that looks like https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/query?semVerLevel=2.0.0&q=%20packageid%3Ayour.packageid
so you can check if that Url works ok from the browser.
The error you are getting suggests that when you open this url https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local
in the browser you get a json with an array under "resources" key and that some object in that array does not have a field "@id". Can you verify that? It should look something like this:
{
"version": "3.0.0",
"resources": [
{
"@id": "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/query",
"@type": "SearchQueryService",
"comment": "Query endpoint of NuGet Search service (primary)"
},
{
"@id": "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration/",
"@type": "RegistrationsBaseUrl",
"comment": "Base URL of Azure storage where NuGet package registration info is stored"
},
[MORE ELEMENTS LIKE THE TWO ABOVE EACH HAVING @id FIELD]
]
}
Hi! This is what I got for https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/query?semVerLevel=2.0.0&q=%20packageid%3A***.Contracts
in the browser. The package version in the project I selected for query is 1.0.17.
{
"totalHits" : 1,
"data" : [ {
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration-semver2/***.contracts/index.json",
"registration" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration-semver2/***.contracts/index.json",
"id" : "***.Contracts",
"version" : "1.0.18",
"description" : "Package Description",
"authors" : [ "***.Contracts" ],
"totalDownloads" : 34,
"verified" : false,
"versions" : [ ... ]
} ]
}
Result https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/
:
{
"version" : "3.0.0",
"resources" : [
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/query",
"@type" : "SearchQueryService",
"comment" : "Query endpoint of NuGet Search service (primary)"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration/",
"@type" : "RegistrationsBaseUrl",
"comment" : "Base URL of Azure storage where NuGet package registration info is stored"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/***-nuget-local",
"@type" : "LegacyGallery"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/***-nuget-local",
"@type" : "LegacyGallery/2.0.0"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/***-nuget-local",
"@type" : "PackagePublish/2.0.0"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/symbols",
"@type" : "SymbolPackagePublish/4.9.0"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/query",
"@type" : "SearchQueryService/3.0.0-rc",
"comment" : "Query endpoint of NuGet Search service (primary) used by RC clients"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration/",
"@type" : "RegistrationsBaseUrl/3.0.0-rc",
"comment" : "Base URL of Azure storage where NuGet package registration info is stored used by RC clients. This base URL does not include SemVer 2.0.0 packages."
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration/{id-lower}/index.json",
"@type" : "PackageDisplayMetadataUriTemplate/3.0.0-rc",
"comment" : "URI template used by NuGet Client to construct display metadata for Packages using ID"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration/{id-lower}/{version-lower}.json",
"@type" : "PackageVersionDisplayMetadataUriTemplate/3.0.0-rc",
"comment" : "URI template used by NuGet Client to construct display metadata for Packages using ID, Version"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/query",
"@type" : "SearchQueryService/3.0.0-beta",
"comment" : "Query endpoint of NuGet Search service (primary) used by beta clients"
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration/",
"@type" : "RegistrationsBaseUrl/3.0.0-beta",
"comment" : "Base URL of Azure storage where NuGet package registration info is stored used by Beta clients. This base URL does not include SemVer 2.0.0 packages."
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration/",
"@type" : "RegistrationsBaseUrl/3.4.0",
"comment" : "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL does not include SemVer 2.0.0 packages."
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration-semver2/",
"@type" : "RegistrationsBaseUrl/3.6.0",
"comment" : "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages."
},
{
"@id" : "https://***.jfrog.io/artifactory/api/nuget/v3/***-nuget-local/registration-semver2/",
"@type" : "RegistrationsBaseUrl/Versioned",
"comment" : "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages.",
"clientVersion" : "4.3.0-alpha"
} ]
}
I think I see what is the problem. We are parsing this json into a C# class and since we can't call class fields @id
and @type
we call them in code atId
and atType
and in order for json deserialization to populate those fields we are first doing responseString.Replace(@"""@id"":", @"""atId"":").Replace(@"""@type"":", @"""atType"":")
. The issue is that in your json the fields have an additional space after the name and before the :
character so our Replace code fails to properly prepare the string for parsing.
I wonder why is your Artifactory adding that additional space since it works for us and we know there are other users using Artifactory without issue as well. Can you tell us what version of Artifactory are you using?
I guess we could modify our replace code to work in either case...
We didn't deploy our own Artifactory, but used the jfrog platform
Yes, I fixed responseString.Replace
and everything worked
Description
Does not find updates for packages located in JFrog Artifactory. The "Online" tab shows packages from JFrog, the "Updates" tab is empty. If you manually change the version in the "packages.config" file, the updated package will be downloaded. There are no errors in the console. The NuGet tool in Rider correctly shows updates from JFrog, so I think the problem is not in the packages themselves or JFrog
Attempting to use protocol version 3 results in an error.
Config