sharepoint - SPListItem.CopyTo method fails when copying to some sub-sites, but not others -


a custom workflow has been developed copies pages top-level site sub-sites. pages copied specific folder within pages library of sub-sites.

this workflow has been installed in 3 site collections , works without problems in 2 of these. in third site collection, achieve mixed results pages copied sub-sites, not others.

an exception raised few levels deep within splistitem.copyto method call. call stack follows:

system.invalidoperationexception: collection modified; enumeration operation may not execute.      @ system.collections.arraylist.arraylistenumeratorsimple.movenext()      @ microsoft.sharepoint.spcopy.copyintoitem(string srcurl, splistitem target, hashtable props, byte[] stream, boolean savestream)      @ microsoft.sharepoint.spcopy.copyintonewitem(hashtable props, byte[] stream, spfolder targetfolder, string targeturl, string srcurl)      @ microsoft.sharepoint.spcopy.copyintonewitem(splistitem src, spfolder targetfolder, string targeturl)      @ microsoft.sharepoint.spcopy.copyintoitem(splistitem src, string targeturl) 

the workflow code ensures associated content type of original page attached destination pages library prior executing copy operation. upon using reflector, appears many arraylist objects used copy properties of original page across; problem seems stemming from.

the pages library within troublesome sub-sites don’t appear different in configuration ones pages copied successfully.

the folder tries copy created workflow subfolder of root folder of destination pages library. uses default folder content type.

in previous version of workflow, code copied pages root folder of pages library , did not encounter issue. using folders in version apply unique security settings pages within folder.

publishing features have been activated site-collection wide , platform using moss 2007.

any thoughts on appreciated.

thanks in advance.

my first instinct check permissions, check of sub sites aren't working have same permissions working.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -