Reputation: 15
We have a requirement where we are in need to implement face verification through cognitive services. I have been following below mentioned link.
https://code.msdn.microsoft.com/windowsdesktop/Face-Verification-c1995f48
When execution comes at tGet.Wait(), system got hanged and never executed next line. enter image description here
Upvotes: 0
Views: 209
Reputation: 2973
Depending on your application, you may have a synchronization context in play, and the current implementation of the client library will result in the deadlock you describe. Here's a pretty decent writeup on contexts.
The workaround I would suggest is the following:
var task = Task.Run(async () => {
try {
await Clnt.GetPersonGroupAsync(groupId);
} catch {
await Clnt.CreatePersonGroupAsync(groupId, groupName);
}
// Use the PersonGroup
);
Upvotes: 1