Hi @ll
I created an activity which is supposed to copy an element from one library to another. I now at least managed to deploy it, see it in SPD and get rid of NullReferenceExceptions. However, now I get FileNotFoundException.
I copied my method below and how somebody can tell me what I'm doing wrong.
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
try
{
using (SPSite srcSite = (SPSite)(__Context.Site))
{
using (SPWeb srcWeb = (SPWeb)(__Context.Web))
{
SPList lib = srcWeb.GetList( ("/libraries/my_lib");
SPListItem item = lib.GetItemById(__ListItem);
SPFile file = srcWeb.GetFile(item.UniqueId);
string destinationURL = "http://myportal/myCopyLib/";
SPFolder destination = srcWeb.GetFolder(destinationURL);
CopyFile(file, destination, destinationURL);
return ActivityExecutionStatus.Closed;
}
}
}
catch (System.Exception e)
{
throw e;
}
}
Thanks in advance,
Autumn