This project has moved and is read-only. For the latest updates, please go here.

Saving a Task

Topics: Setup
Nov 30, 2012 at 11:45 PM

Is it possible to save a Task to a file to be called from later?

Dec 1, 2012 at 12:46 AM

Yes, use the Task.Export method to write out the file and then use the TaskFolder.ImportTask method to bring it back in.

Dec 3, 2012 at 8:07 PM

I guess I worded the question wrong.  I want to save the Task object to a file while the code is running.  When I try to save using the TaskSchedulerWizard object, I get an error because the Task object is null.

Dec 4, 2012 at 3:52 AM

TaskDefinition has an Xml property which can be saved to a file and then used by the TaskFolder.ImportTask method to import and register or it can be brought into a string and used to set the same Xml property at a later time. The reason the Task object is null is because the task has not yet been registered.