   XNA InvalidOpperationException in foreach loop
  ok, the purpose of this code is to remove all Bullets and Soldiers on the map once certain event are triggeredTHIS IS THE ENTIRE VOID"private void Cleanup()   {  if (Bulletlist.Count > 0)  { foreach (Bullet bullet in Bulletlist) // 'in' causes ErrorBulletlist.Remove(bullet);  }  if (NPCList.Count > 0)  { foreach (NPC soldier in NPCList)NPCList.Remove(soldier);  }   }when i run this code and execute this method I get an InvalidOperationException at the Keyword 'in' and i cant figure out why this is trippingAny ideas?   
  You cannot modify a list you are enumerating. Furthermore, just set the list to null, or create a new list in its place and let the GC deal with cleaning up your discarded list of bullets and soldiers, or call List.Clear().   ;  Beautiful. thanks :)   