‘System.Threading.Tasks.Task’ does not contain a definition for ‘Result’

‘System.Threading.Tasks.Task’ does not contain a definition for ‘Result’ and no extension method ‘Result’ accepting a first argument of type ‘System.Threading.Tasks.Task’ could be found (are you missing a using directive or an assembly reference?)

This is an annoying error that I spent about an hour trying to source. It turned out, I had a bad parameter in the ContinueWith. Stupid TPL. Stupid Compiler.

.ContinueWith(task => { DoWork(task.Result); },MyScheduler);

So, make sure your parameters are correct. i.e. ensure that you have an actual taskscheduler instead of a dispatcher or whatever. Happy Coding!

1 thought on “‘System.Threading.Tasks.Task’ does not contain a definition for ‘Result’”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.