I'm trying to move a SPFolder (which is really a document set) to another document library for archiving purposes. CopyTo works fine, but of course it doesn't include the document versions and the metadata is updated to the current user and date. I can get the SPFolder object fine and like I said, CopyTo work to get it to the new library, but MoveTo ONLY works if moving it to a folder within the same document library. I haven't seen anything to indicate that this the normal behavior online. The only error is"This operation is not supported." This happens whether using a relative URL for the parameter or a full URL. The only thing in the logs I can find is :
System.Runtime.InteropServices.COMException: <nativehr>0x810705a6</nativehr><nativestack>OWSSVR.DLL: (unresolved symbol, module offset=00000000001490A1)
at 0x00007FF9B84690A1 </nativestack>This operation is not supported., StackTrace:
at Microsoft.SharePoint.SPFolder.MoveCopyInternal(String strNewUrl, Boolean bIsCopy)
at ArchivePDI.Program.Main(String[] args)
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Below is a sample of the code:
SPSite site = new SPSite(siteUrl); SPWeb web = site.OpenWeb(); SPFolderCollection folders = web.Folders; SPFolder projectFolders = folders[sourceFolder]; SPFolder sourceProjFolder = projectFolders.SubFolders[sourceFolder + "/" + projTitle]; sourceProjFolder.MoveTo(siteUrl + "/" + targetFolder + "/" + projTitle); Yes, Document Sets are enabled on both libraries. Has anyone else run into this before? Thanks!