I have the following method that is triggered when an exception occurs in a part of my Metro application
void Model_ExceptionOccured(Exception ex)
{
var dlg = new Windows.UI.Popups.MessageDialog("An exception occured during verification: " + ex.Message, "Exception");
dlg.ShowAsync();
}
The 'dlg.ShowAsync()'-call is asynchronous, but I don't care to wait for the result. The compiler generates a warning for it though:
Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
Should I care? Is there any reason I should add the await keyword, other than to get rid of the warning?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…