Closed rubens-farias closed 4 years ago
There are multiple issues logged with this resolution. Here it is again:
foreach (var t in tasks)
t.Enabled = enabled;
Hi @dahall, thanks for your reply; I've tried to look for that error message before asking here, but nothing came up.
I've made the change and noticed the RegisterChanges call isn't necessary, that was the mistake. Thanks!
--Rubens
I can't set a local task to enabled/disabled as it returns the error message: "Tasks which have been registered previously with stored passwords must use the TaskFolder.RegisterTaskDefinition method for updates."
Steps to reproduce the behavior: var enabled = Configuration.Enabling; var tasks = TaskService.Instance.FindAllTasks( task => task.Folder.Name.Equals(Configuration.MesFolderName, ignoreCase) && Configuration.Filter.IsMatch(task.Name)); foreach (var task in tasks) { try { task.Definition.Settings.Enabled = enabled; task.RegisterChanges(); } catch (Exception ex) { Logger.Error(ex); } }
Environment:
That task have a saved password and I would like to do not have to store it locally for creating a new task.