Collection was modified; enumeration operation may not execute.
The problem is because we are updating the item collection. The solution is to use a decrementing 'FOR' loop. Before use it, I filter the items with a SPQuery to finish the FOR loop quickly.
Here is my example:
SPList recursos = properties.OpenWeb().Lists["
SPQuery query = new SPQuery();
string filtro = "";
filtro += "
filtro += "
filtro += "
filtro += properties.ListItemId.
filtro += "";
filtro += "";
if (!string.IsNullOrEmpty(filtro)
{
}
SPListItemCollection coleccion = recursos.GetItems(query);
try
{
}
}
catch(Exception ex)
{
}








































