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

Triggers.Add() Throws Error in Build 56462

Sep 10, 2010 at 3:15 PM

For both lines using Triggers.Add() in C#, I get this error:

Microsoft.Win32.TaskScheduler.WeeklyTrigger' does not contain a constructor that takes '0' arguments


DateTime dt = Common.formatTimeForLoading(days_times.get(day));
dt = dt.AddMinutes(Convert.ToDouble(offset_delay));

Microsoft.Win32.TaskScheduler.DaysOfTheWeek theday = (Microsoft.Win32.TaskScheduler.DaysOfTheWeek)Enum.Parse(typeof(Microsoft.Win32.TaskScheduler.DaysOfTheWeek), char.ToUpper(day[0]) + day.Substring(1));
td.Triggers.Add(new Microsoft.Win32.TaskScheduler.WeeklyTrigger { StartBoundary = dt, DaysOfWeek = theday });
td_bg.Triggers.Add(new Microsoft.Win32.TaskScheduler.WeeklyTrigger { StartBoundary = dt, DaysOfWeek = theday });


These lines did not throw an error with build 54519.



Sep 10, 2010 at 10:17 PM

I just tested this code (as close as I could make it at least) and did not have an error when compiling or executing. Please try to clean and recompile and see if the error persists. The constructor and arguments did not change between the two versions.

Sep 14, 2010 at 7:42 PM

I cleared out all the built files and attempted to rebuild. Same error.

I removed the dll reference from the project and re-added it, then attempted to rebuild.  Same error.