示例#1
0
        public async Task ListVersions()
        {
            // Find all versions of a package (including unlisted versions).
            var client = new NuGetClient("https://api.nuget.org/v3/index.json");

            var packageVersions = await client.ListPackageVersions("Newtonsoft.Json", includeUnlisted : true);

            if (!packageVersions.Any())
            {
                Console.WriteLine($"Package 'Newtonsoft.Json' does not exist");
                return;
            }

            Console.WriteLine($"Found {packageVersions.Count} versions");
        }