I have a problem with my tasks. When I try to recive returned variable from my task I can't use a .Result property to get it. Here is my code:
var nextElement = dir.GetValue(i++).ToString();
Task buffering = Task<byte[]>.Run(() => imageHashing(nextElement));
bitmapBuffer = buffering.Result;
and imageHasing function is declared like this:public bool[] imageHashing(string path)
I get an error saing:
Severity Code Description Project File Line Suppression State Error CS1061 'Task' does not contain a definition for 'Result' and no extension method 'Result' accepting a first argument of type 'Task' could be found (are you missing a using directive or an assembly reference?)
Example from this microsoft website works, and I can't understand why.
See Question&Answers more detail:os