Hello, I have what I consider to be a very simple implementation. All I am doing is simply finding a task and getting info for it. When I run my program on Windows 8 it works great. When I try it on Windows XP Pro w/SP3 I get the following error message:
[MyAppName]
[MyAppName] has encountered a problem and needs to close. We are sorry for this inconvenience.
It then gives me a choice of whether or not to "Send Error Report"...
[MyAppName]
[MyAppName] has encountered a problem and needs to close. We are sorry for this inconvenience.
It then gives me a choice of whether or not to "Send Error Report"...
Here's my code...
string TaskName = "Crazy Task!";
using (TaskService ts = new TaskService())
{
Task t = ts.FindTask (TaskName, true);
if (t != null)
{
StringBuilder Message = new StringBuilder();
Message.AppendLine("Found task '" + TaskName + "':");
Message.AppendLine();
Message.AppendLine("Enabled = " + t.Enabled.ToString());
Message.AppendLine("IsActive = " + t.IsActive.ToString());
Message.AppendLine("LastRunTime = " + t.LastRunTime.ToString());
Message.AppendLine("LastTaskResult = " + t.LastTaskResult.ToString());
Message.AppendLine("Name = " + t.Name);
Message.AppendLine("NextRunTime = " + t.NextRunTime.ToString());
Message.AppendLine("NumberOfMissedRuns = " + t.NumberOfMissedRuns.ToString());
Message.AppendLine("Path = " + t.Path);
Message.AppendLine("State = " + t.State.ToString());
MessageBox.Show(Message.ToString());
}
else
{
MessageBox.Show("Could not find task '" + TaskName + "'");
}
}
What is causing the problem?