Ошибка при вызове async метода - C#
Формулировка задачи:
Метод взят с msdn
И его вызов. Взят оттуда же
private async Task<FaceAttributes[]> UploadAndDetectFaces(string imageFilePath)
{
try
{
using(Stream imageFileStream = File.OpenRead(imageFilePath))
{
var faces = await faceServiceClient.DetectAsync(imageFilePath);
var faceAttributes = faces.Select(face => face.FaceAttributes);
return faceAttributes.ToArray();
}
}
catch (System.Exception)
{
return new FaceAttributes[0];
}
}FaceAttributes[] faceAttributes = await UploadAndDetectFaces(fileNames[0]);
Решение задачи: «Ошибка при вызове async метода»
textual
Листинг программы
FaceAttributes[] faceAttributes = await UploadAndDetectFaces(fileNames[0]);