Saving a Task

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

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

Nov 30, 2012 at 11:46 PM

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 7: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 2: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.