Beispiel #1
0
        public async Task Exists()
        {
            // Check if a package exists.
            NuGetClient client = new NuGetClient("https://api.nuget.org/v3/index.json");

            if (!await client.ExistsAsync("newtonsoft.json"))
            {
                Console.WriteLine("Package 'newtonsoft.json' does not exist!");
            }

            var packageVersion = NuGetVersion.Parse("12.0.1");

            if (!await client.ExistsAsync("newtonsoft.json", packageVersion))
            {
                Console.WriteLine("Package 'newtonsoft.json' version '12.0.1' does not exist!");
            }
        }