Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8057255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:58:25+00:00 2026-06-05T08:58:25+00:00

I am making a custom Activity for SharePoint 2010. When I drop the activity

  • 0

I am making a custom Activity for SharePoint 2010. When I drop the activity in the SharePoint Designer and supply values for the parameters, I get a mysterious validation error that simply says:

This action has required parameters that are missing.

Here’s the source code for the action:

using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Workflow.ComponentModel;
using System.Workflow.Activities;
using System.Workflow.ComponentModel.Compiler;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WorkflowActions;

namespace SharePoint.Activities.IO
{
    public partial class CopyFile : SequenceActivity
    {
        public CopyFile()
        {
            InitializeComponent();
        }

        public static DependencyProperty SourceDirectoryProperty = DependencyProperty.Register("SourceDirectory", typeof(string), typeof(CopyFile));
        public static DependencyProperty TargetDirectoryProperty = DependencyProperty.Register("TargetDirectory", typeof(string), typeof(CopyFile));
        public static DependencyProperty ActionResultProperty = DependencyProperty.Register("ActionResult", typeof(string), typeof(CopyFile));
        public static DependencyProperty CreateDateProperty = DependencyProperty.Register("CreateDate", typeof(DateTime), typeof(CopyFile));
        public static DependencyProperty CompletionDateProperty = DependencyProperty.Register("CompletionDate", typeof(DateTime), typeof(CopyFile));
        public static DependencyProperty WFContextProperty = DependencyProperty.Register("WFContext", typeof(WorkflowContext), typeof(CopyFile));

        [Description("Path the files to perform the operation on")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [ValidationOption(ValidationOption.Required)]
        public string SourceDirectory
        {
            get { return (string)GetValue(SourceDirectoryProperty); }
            set { SetValue(SourceDirectoryProperty, value); }
        }
        [Description("Path the files are copied to")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [ValidationOption(ValidationOption.Required)]
        public string TargetDirectory
        {
            get { return (string)GetValue(TargetDirectoryProperty); }
            set { SetValue(TargetDirectoryProperty, value); }
        }
        [Description("Once the the operation completes, this is set to OK or the exception information")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [ValidationOption(ValidationOption.Optional)]
        public string ActionResult
        {
            get { return (string)GetValue(ActionResultProperty); }
            set { SetValue(ActionResultProperty, value); }
        }
        [Description("When the request was created")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [ValidationOption(ValidationOption.Optional)]
        public DateTime CreateDate
        {
            get { return (DateTime)GetValue(CreateDateProperty); }
            set { SetValue(CreateDateProperty, value); }
        }
        [Description("When execution stoped")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [ValidationOption(ValidationOption.Optional)]
        public DateTime CompletionDate
        {
            get { return (DateTime)GetValue(CompletionDateProperty); }
            set { SetValue(CompletionDateProperty, value); }
        }

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public WorkflowContext WFContext
        {
            get { return (WorkflowContext)GetValue(WFContextProperty); }
            set { SetValue(WFContextProperty, value); }
        }

        //protected override void Initialize(IServiceProvider provider)
        //{
        //    TraceIn();
        //    base.Initialize(provider);
        //    TraceOut();
        //}

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            TraceIn();

            Debugger.Break();

            var isSiteAdmin = false;
            CreateDate = DateTime.Now;
            try
            {
                // Needs administrative credentials to get the web application properties ino
                SPSecurity.RunWithElevatedPrivileges(delegate
                {
                    using (var site = new SPSite(WFContext.Site.ID))
                    {
                        using (var web = site.AllWebs[WFContext.Web.ID])
                        {
                            isSiteAdmin = web.CurrentUser.IsSiteAdmin;
                            if (string.IsNullOrEmpty(SourceDirectory)) throw new ArgumentException("SourceDirectory cannot be null or empty");
                            if (!Directory.Exists(SourceDirectory)) throw new DirectoryNotFoundException("Could not find source directory: \"" + SourceDirectory + "\"");

                            if (string.IsNullOrEmpty(TargetDirectory)) throw new ArgumentException("TargetDirectory cannot be null or empty");
                            if (!Directory.Exists(TargetDirectory)) throw new DirectoryNotFoundException("Could not find target directory: \"" + TargetDirectory + "\"");
                            // Do something 
                            Debug.WriteLine(string.Format("Doing something amazing from {0} and moving it to {1}", SourceDirectory, TargetDirectory));
                        }
                    }
                });

                ActionResult = "OK";
            }
            catch (Exception ex)
            {
                ActionResult = isSiteAdmin ? ex.ToString() : ex.Message;
            }
            CompletionDate = DateTime.Now;

            var result = base.Execute(executionContext);

            TraceOut();

            return result;
        }

        private static void TraceIn()
        {
            Trace("Entering");
        }

        private static void TraceOut()
        {
            Trace("Exiting");
        }

        private static void Trace(string direction)
        {
            Debugger.Launch();
            var stackTrace = new StackTrace(2, false);
            var frame = stackTrace.GetFrame(0);
            Debug.WriteLine(direction + " " + frame.GetMethod().Name);
        }
    }
}

Here is the .action file.

<?xml version="1.0" encoding="utf-8" ?>
<WorkflowInfo>
    <Actions
        Sequential="then"
        Parallel="and">
        <Action
            Name="IO Activities"
            ClassName="SharePoint.Activities.IO.CopyFile"
            Assembly="SharePoint.Activities.IO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abfb622251cf6982"
            Category="Custom Actions"
            AppliesTo="all">
            <RuleDesigner
                Sentence="CopyFiles from %1 to %2">
                <FieldBind
                    Field="SourceDirectory"
                    DesignerType="String"
                    Id="1"/>
                <FieldBind
                    Field="TargetDirectory"
                    DesignerType="String"
                    Id="2"/>
            </RuleDesigner>
            <Parameters>
                <Parameter
                    Name="SourceDirectory"
                    Type="System.String, mscorlib"
                    Direction="In"
                    DesignerType="StringBuilder"
                    Description="Directory where the source files are to move" />
                <Parameter
                    Name="TargetDirectory"
                    Type="System.String, mscorlib"
                    Direction="In"
                    DesignerType="StringBuilder"
                    Description="Directory where the files will be placed" />
                <Parameter
                    Name="ActionResult"
                    Type="System.String, mscorlib"
                    Direction="Optional" 
                    DesignerType="Hide" />
                <Parameter
                    Name="CreateDate"
                    Type="System.DateTime, mscorlib"
                    Direction="Optional" 
                    DesignerType="Hide" />
                <Parameter
                    Name="CompletionDate"
                    Type="System.DateTime, mscorlib"
                    Direction="Optional" 
                    DesignerType="Hide" />

                <Parameter 
                    Name="WFContext" 
                    Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext, Microsoft.SharePoint.WorkflowActions" 
                    DesignerType="Hide" />
            </Parameters>
        </Action>
    </Actions>
</WorkflowInfo>

Here’s a link to my post on social.msdn.microsoft.com.

Update

I’ve even tried removing all of the parameters by commenting out the parameters in the .actions files, the properties in the class, and commenting out the DependencyProperties. I still get the same error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:58:29+00:00Added an answer on June 5, 2026 at 8:58 am

    Ultimately, it looks like the issue (after I tore the project down and started over) was an incorrect designer type and a missing .

    Here is the old code:

    <FieldBind Field="Result" DesignerType="TextArea" Text="Action result message; returns OK on success" Id="3" />
    

    Here is the correct code:

    <FieldBind Field="Result" DesignerType="ParameterNames" Text="Action result message; returns OK on success" Id="3" />
    

    Once that change was made, everything seems to be working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a plugin that triggers on the create message of a custom activity
I'm making a custom event calendar with PHP. I am trying to get the
I'm making a custom control that can be dragged around and it is semi
I'm making a custom error dialog in my WPF app and I want to
I'm making a custom generator that generates a new rails app, and I do
So i'm making a custom View that displays some graphs (plots), and in some
I'm making a custom lock screen. The lock screen is an activity which I
I'm making an app that displays a custom notification in the notification bar, and
I'm making a custom control that's an expandable/collapsable panel, which I can then fill
I am making an iPhone app in which I have made a custom activity

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.