try-catch the process.start and do it on another thread
This commit is contained in:
parent
e48ce2f9cf
commit
931b866ea9
1 changed files with 9 additions and 1 deletions
|
@ -68,7 +68,15 @@ namespace CollabVMAgent
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Console.WriteLine($"Successfully wrote {msg.Filename} ({msg.FileData.Length} bytes)");
|
Console.WriteLine($"Successfully wrote {msg.Filename} ({msg.FileData.Length} bytes)");
|
||||||
#endif
|
#endif
|
||||||
Process.Start(UploadsFolder + @"\" + msg.Filename);
|
try
|
||||||
|
{
|
||||||
|
new Thread(() => Process.Start(UploadsFolder + @"\" + msg.Filename)).Start();
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
Console.WriteLine($"Failed to run {msg.Filename}: {ex.Message}");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue