title: C# compile error: “X is inaccessible due to its protection level”
body: <p>when c# gives this compile error?</p>
  
  <blockquote>
    <p>'Favorite.Favorites.FavoriteCollection' is inaccessible due to its protection level   </p>
  </blockquote>
  
  <pre><code>private void Form1_Load(object sender, EventArgs e)
  {
      Favorites objFavorites = new Favorites(); 
  
      objFavorites.ScanFavorites();
      foreach (WebFavorite objWebFavorite in objFavorites.FavoriteCollection)
      {
          ListViewItem objListViewItem = new ListViewItem();
          objListViewItem.Text = objWebFavorite.Name;
          objListViewItem.SubItems.Add(objWebFavorite.Url);
          lstFavorites.Items.Add(objListViewItem);
      }
  }
  </code></pre>