catch (DiagnosticsCollectionStartFailedHubException ex)
Shut down other profilers, performance monitors, or secondary Visual Studio instances debugging the same process.
From the Visual Studio Installer → select More → Repair . This restores missing or corrupted Diagnostic Hub components.
try