Filip Popović
Filip Popović

Reputation: 2655

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!

Upvotes: 3

Views: 212

Answers (1)

Edmund Schweppe
Edmund Schweppe

Reputation: 5132

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;
        }
    }
}

Upvotes: 2

Related Questions