I have a Winforms exe and from a menu I launch a slow-running process as a Task. It should take about 30 seconds to get the data and then show a dialog. Usually it no longer returns. I catch exceptions and nothing appears in the log so I know it's run ok. The form just never appears, and no CPU time seems to be taking up. Yet I run it in the debugger and step through the code and it works fine. Occasionally it does seem to work on a faster PC. What is happening?
private async void inPlayRecordToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!GetClient()) return;
{
await Task.Run(() =>
{
LaunchForm();
});
}
}
private async void LaunchForm()
{
try
{
{
var inPlayView = new InPlayView();
await inPlayView.GetData();
inPlayView.ShowDialog();
}
}
catch (Exception ex)
{
Logger.LogMessage(ex.ToString());
}
}