Search code examples
sql-server-2008ssisssis-2008

Custom SSIS task - Version property


We have a custom SSIS task (not component), and need to add new property. It would be good to support SSIS upgrade feature, so all clients have to do with existing packages is to upgrade them.

We already implemented Update and CanUpdate methods, but we can't find the way to update Version property of custom task, since it is read-only.

Is there any way to set Version property?

Thanks everyone!


Solution

  • The Task.Version property is virtual (as are the Update and CanUpdate methods), so you can override it in the same manner:

    [DtsTask (/* whatever your task attributes are */)]
    public class MyDemoTask : Task
    {
        public override bool CanUpdate(string CreationName)
        {
            // your code here
        }
        public override void Update(ref string ObjectXml)
        {
            // your code here
        }
        public override int Version
        {
            get
            {
                return 42;
            }
        }
    }