none
CopyTo method error, keynotfoundexception RRS feed

  • Question

  • Hi,

    I have a problem when i try to use CopyTo method, each first time i use a workflow with it  CopyTo method throw an keynotfound exception.
    If i retry, no problem.
    The exception only occurs the first time.

    Any idea about this problem ?

    Regards,

    Loïc M.
    Tuesday, November 17, 2009 8:57 AM

Answers

  • Find a fix :
    Use workflowproperty.Item.File.CopyTo method instead of workflowproperty.Item.CopyTo
    • Marked as answer by Loïc M. _ Monday, November 23, 2009 3:29 PM
    Monday, November 23, 2009 3:29 PM

All replies

  • Please check the ULS log for additional information and post it here.  Also, try debugging your wf to see where exactly it is throwing the error.
    Wednesday, November 18, 2009 1:18 AM
  • As i said before the problem come  from copyto method ( i have used debbuguer with clr exception throw and debug unmanaged code to see where the problem come from... ):

    11/23/2009 11:57:17.97     w3wp.exe (0x1100)                           0x1B10    Windows SharePoint Services       Workflow Infrastructure           88xr    Unexpected    WinWF Internal Error, terminating workflow Id# 33922a13-cd74-49b3-aa24-4a0dcd6eeb03     
    11/23/2009 11:57:17.97     w3wp.exe (0x1100)                           0x1B10    Windows SharePoint Services       Workflow Infrastructure           98d4    Unexpected    System.ArgumentException: La valeur n'est pas comprise dans la plage attendue.     à Microsoft.SharePoint.SPFieldMap.GetColumnNumber(String strFieldName)     à Microsoft.SharePoint.SPListItemCollection.GetRawValue(String fieldname, Int32 iIndex)     à Microsoft.SharePoint.SPListItem.GetValue(SPField fld, Int32 columnNumber, Boolean bRaw)     à Microsoft.SharePoint.SPListItem.get_Item(Guid fieldId)     à Microsoft.SharePoint.SPCopy.FieldInfoFromField(SPField field, SPListItem item)     à Microsoft.SharePoint.SPCopy.GetPropertyHashFromItemFields(SPListItem item)     à Microsoft.SharePoint.SPCopy.CopyIntoNewItem(SPListItem src, SPFolder targetFolder, String targetUrl)     à Microsoft.SharePoint.SPCopy.CopyIntoItem(SPListItem src, String targetUrl)     à Microsoft.SharePoint.SPListItem.CopyTo(...     
    11/23/2009 11:57:17.97*    w3wp.exe (0x1100)                           0x1B10    Windows SharePoint Services       Workflow Infrastructure           98d4    Unexpected    ...String destinationUrl)     à DocumentInstall.Workflow1.DeplacementDunDossier_ExecuteCode(Object sender, EventArgs e)     à System.Workflow.ComponentModel.Activity.RaiseEvent(DependencyProperty dependencyEvent, Object sender, EventArgs e)     à System.Workflow.Activities.CodeActivity.Execute(ActivityExecutionContext executionContext)     à System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)     à System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)     à System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)     à System.Workflow.Runtime.Scheduler.Run()    

    What's weird is that if i retry to launch the wf, no problem/error. But if i delete it and re add it the error came back.

    the code that throw the error :

     workflowproperty.Item.CopyTo(workflowproperty.Web.Url + "/" + PathOfTheList+ "/" + workflowproperty.Item.Name);




    Monday, November 23, 2009 11:01 AM
  • Find a fix :
    Use workflowproperty.Item.File.CopyTo method instead of workflowproperty.Item.CopyTo
    • Marked as answer by Loïc M. _ Monday, November 23, 2009 3:29 PM
    Monday, November 23, 2009 3:29 PM