title: C# building a tool to collect project Nuget information
body: <p>I'm building a small C# program to collect information on the used nuget packages</p>
  
  <p>This is every piece of info i want:</p>
  
  <pre><code>public class Package
  {
      public string Version { get; set; }
      public string Name { get; set; }
      public string Description { get; set; }
      public int Count { get; set; }
      public List&lt;string&gt; Versions { get; set; }
      }
  </code></pre>
  
  <p>And this is how i collect all the info:</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public Dictionary&lt;string, Package&gt; Packages;
      public string Folder;
      public SaveFileDialog saveFileDialog = new SaveFileDialog();
      public FolderBrowserDialog folderBrowseDialog = new FolderBrowserDialog();
      public MainWindow()
      {
          InitializeComponent();
          Packages = new Dictionary&lt;string, Package&gt;();
      }
  
      private void SearchBtn_Click(object sender, RoutedEventArgs e)
      {
          DialogResult result = folderBrowseDialog.ShowDialog();
          if (result == System.Windows.Forms.DialogResult.OK)
          {
              DoneLbl.Content = "Started";
              Folder = folderBrowseDialog.SelectedPath;
              foreach (string fileName in Directory.EnumerateFiles(Folder, "packages.config", SearchOption.AllDirectories))
              {
                  var file = new PackageReferenceFile(fileName);
                  foreach (PackageReference packageReference in file.GetPackageReferences())
                  {
                      if (Packages.ContainsKey(packageReference.Id))
                      {
                          Packages[packageReference.Id].Count++;
                          if (Packages[packageReference.Id].Versions.Contains(packageReference.Version.ToString()))
                          {
  
                          }
                          else
                          {
                              var oldVersion = new Version(Packages[packageReference.Id].Version);
                              var newVersion = new Version(packageReference.Version.ToString());
                              if (newVersion &gt; oldVersion)
                              {
                                  Packages[packageReference.Id].Version = packageReference.Version.ToString();
                              }
                              Packages[packageReference.Id].Versions.Add(packageReference.Version.ToString());
                          }
                      }
                      else
                      {
                          var package = new Package();
                          package.Name = packageReference.Id;
                          package.Count = 1;
                          package.Version = packageReference.Version.ToString();
                          package.Versions = new List&lt;string&gt;();
                          package.Versions.Add(packageReference.Version.ToString());
                          Packages.Add(packageReference.Id, package);
                      }
                  }
                  DoneLbl.Content = "Done";
              }
          }
      }
  
      private void ExportBtn_Click(object sender, RoutedEventArgs e)
      {
          saveFileDialog.Filter = "Text File | *.txt";
          DialogResult result = saveFileDialog.ShowDialog();
  
          if (result == System.Windows.Forms.DialogResult.OK)
          {
              string lines = "Nuget Packages for \r\n" + Folder + "\r\n";
  
              foreach (var Package in Packages)
              {
                  lines += "********************\r\n";
                  lines += "Name: " + Package.Value.Name + "\r\n";
                  lines += "Version: " + Package.Value.Version + "\r\n";
                  lines += "Different Versions: " + Package.Value.Versions.Count + "\r\n";
                  lines += "Description: " + Package.Value.Description + "\r\n";
                  lines += "Count: " + Package.Value.Count + "\r\n";
              }
  
              StreamWriter file = new StreamWriter(saveFileDialog.FileName);
              file.WriteLine(lines);
  
              file.Close();
          }
      }
  }
  </code></pre>
  
  <p>This gets everything through "Nuget.Core" nuget package.
  But i still lack the description. Is there a way to find package description through this nuget package? Or any other way i can use to find package descriptions?</p>