Wednesday, March 28, 2012

How to get the Task name inside your custom task

I have a custom task, and during the Execute method I'd like to get hold of the task's name. It appears that this is held on the TaskHost, but I cannot see how to obtain that from within the task itself. Anyone got any ideas?

Thanks

DarrenSystem::TaskName|||or better still, System::SourceName Smile|||Kirk

really?

You go out to the variables collection to get your own name?

Could you explain the reasoning?
Allan|||Hello KirkHaselden@.discussions.microsoft.com, Thanks Kirk. I saw that the property only appears on the TaskHost but thought it a little long winded to get your own name. Thanks Allan
> Well, yes. Since Name is on the TaskHost, it's not available anywhere
> else.
> K|||Well, yes. Since Name is on the TaskHost, it's not available anywhere else.
K|||Jamie.

I think SourceName is only added to the Variables list if your package has Event Handlers.
Allan

No comments:

Post a Comment