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

COMException: the task has been configured (...)

Aug 8, 2011 at 7:28 PM
Edited Aug 8, 2011 at 7:44 PM

Good evening,

I am trying to set userid for a task:

td.Principal.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
ts.RootFolder.RegisterTaskDefinition("SataPriceChecker", td);

But I get an exception COMException: the task has been configured with an unsupported combination of account settings and run time options.

Is there a way to solve it under XP?


Aug 9, 2011 at 12:05 AM

Instead of using Principal.UserId, I would put it all in the RegisterTaskDefinition method with the extra parameters as follows:

ts.RootFolder.RegisterTaskDefinition("SataPriceChecker", td, TaskCreation.Create, "domain\userid", null, TaskLogonType.InteractiveToken);

If you want to do it with the user's password:

ts.RootFolder.RegisterTaskDefinition("SataPriceChecker", td, TaskCreation.Create, "domain\userid", "password", TaskLogonType.Password);
Aug 9, 2011 at 1:27 PM

It is solved. Thanks for the help