This error occurred to me when i was trying to programmatically approve a task in the SharePoint 2010.
Later on I found that the problem is the Task List do not have the content Type WorkFlow Task inherited. After i add that content type it worked for me.
Comments
Go to list settings and go advance setting and make Allow COntent Type changes to yes;
Then you can see available content types related to that list