I have converted my code as much as possible line for line from old asp.net to .net core.
One piece of code is not working and I think it is because a deadlock is happening on an async method call.
Translating the code directly from its previous equivalent, the code is like this:
//loop at this level - many health checks to carry out
try
{
bool result = await healthCheckable.GetHealthAsync();
}
catch(Exception ex)
{
}
note that an exception is raised each time the healthcheck code is executed in this scenario as a service is down.
The first time around the loop the exception is caught correctly, the second time around, the code simply hangs on the healthservice check.
I have tried .Wait() and I have tried .Result; and I have tried ConfigureAwait(false) - all the way up the call tree
At this point I have no clue what to try next.. help?