Skip to content
Permalink
Browse files

[NuGet] Use SourceCacheContext to avoid ArgumentException

  • Loading branch information
xen2 committed Nov 27, 2018
1 parent 881c97f commit b82520bc82da27d45737b577c64d512e326c2e37
Showing with 8 additions and 5 deletions.
  1. +8 −5 sources/assets/Xenko.Core.Packages/NugetStore.cs
@@ -568,13 +568,16 @@ public async Task<IEnumerable<NugetPackage>> GetUpdates(PackageName packageName,
var foundPackage = await NuGetPackageManager.GetLatestVersionAsync(packageName.Id, NuGetFramework.AgnosticFramework, resolutionContext, repositories, NativeLogger, cancellationToken);
if (packageName.Version.ToNuGetVersion() <= foundPackage.LatestVersion)
{
foreach (var repo in repositories)
using (var context = new SourceCacheContext())
{
var metadataResource = await repo.GetResourceAsync<PackageMetadataResource>(cancellationToken);
var metadataList = await metadataResource.GetMetadataAsync(packageName.Id, includePrerelease, includeAllVersions, null, NativeLogger, cancellationToken);
foreach (var metadata in metadataList)
foreach (var repo in repositories)
{
res.Add(new NugetServerPackage(metadata, repo.PackageSource.Source));
var metadataResource = await repo.GetResourceAsync<PackageMetadataResource>(cancellationToken);
var metadataList = await metadataResource.GetMetadataAsync(packageName.Id, includePrerelease, includeAllVersions, context, NativeLogger, cancellationToken);
foreach (var metadata in metadataList)
{
res.Add(new NugetServerPackage(metadata, repo.PackageSource.Source));
}
}
}
}

0 comments on commit b82520b

Please sign in to comment.
You can’t perform that action at this time.