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

Unexplained Error On Windows XP Pro SP3

Topics: Errors
Aug 22, 2013 at 11:38 PM
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] 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("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("Could not find task '" + TaskName + "'");

What is causing the problem?
Aug 23, 2013 at 12:12 AM
I found the problem. It's the line containing t.NumberOfMissedRuns.ToString()

Not sure what is happening, but when I comment out that line everything works fine.
Aug 23, 2013 at 4:21 PM
If you look at the error, you will notice that it is a NotV1SupportedException. This exception will be thrown whenever you are accessing a portion of the library from older versions of Windows (like XP) that don't support all of the current functionality.