(Process process)
| 486 | } |
| 487 | |
| 488 | private void TryKillProcess(Process process) |
| 489 | { |
| 490 | try |
| 491 | { |
| 492 | if (!process.HasExited) |
| 493 | { |
| 494 | process.Kill(); |
| 495 | } |
| 496 | } |
| 497 | catch (Exception ex) when (ex is InvalidOperationException or System.ComponentModel.Win32Exception) |
| 498 | { |
| 499 | if (_logger.IsEnabled(LogEventLevel.Debug)) |
| 500 | { |
| 501 | _logger.Debug($"Failed to kill process: {ex.Message}"); |
| 502 | } |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | /// <summary> |
| 507 | /// Waits until the service is initialized, or the timeout set |