In the Application_Exit application, I am trying to set an alarm using ScheduledActionService. This works fine in other code, but here it continues to throw an argument with the message E_INVALIDARG
Here is the code
string alarmName = Guid.NewGuid().ToString();
const string cookingClockAlarm = "Cooking clock alarm";
DateTime dueTime = DateTime.Now.AddSeconds(10);
var alarm = new Alarm(alarmName)
{
Content = cookingClockAlarm,
BeginTime = dueTime,
ExpirationTime = dueTime.AddSeconds(3),
RecurrenceType = RecurrenceInterval.None
};
ScheduledActionService.Add(alarm);
Any ideas what I'm doing wrong here?
source
share