RobotStudio event

[PC SDK] Restoring Backup Programatically

Hi,

I'm trying to restore a backup with the Controller.Restore function, but I'm having a "Wait for mode failed" exception when the controller restarts. The code i'm using, following the remarks of the restore reference (Requires mastership of Rapid and Configuration domains. Requires UAS_RESTORE grant. Requires Auto mode.) is:

using (Mastership m = Mastership.Request(cont.Rapid))
using (Mastership m2 = Mastership.Request(cont.Configuration))
{
cont.Restore(backup_path);
}

Any idea? Regards,
HM