Archive

Posts Tagged ‘Problem Solving’

How to fix “Collection was modified; enumeration operation may not execute. “when using Copy.asmx in SharePoint2010

April 21, 2012 Leave a comment

Problem:

In my current project, we use copy.asmx web services in SharePoint2010 to upload a document to a document library. In one of the document library, when uploading a document with a choice field, it blows up and the error message is Collection was modified; enumeration operation may not execute.

Analysis:

After some research , we found out the problem is that we have 2 content types that both have a field called Document Type , although the internal name are different but the display name are exactly the same and this cause the problem. I am still not too sure why, it could possibly a SharePoint bug.

Solution:

After rename one of the field display name to a different name, it works like a charm. You can download source code with the problem here and source code without the problem here.

Follow

Get every new post delivered to your Inbox.

Join 143 other followers