Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle exception when runtime instance shuts down while enumerating processes #2369

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -26,6 +27,11 @@ public async Task<IEnumerable<IEndpointInfo>> GetEndpointInfoAsync(CancellationT
{
return EndpointInfo.FromProcessId(pid);
}
// Catch when runtime instance shuts down while attepting to use the established diagnostic port connection.
catch (EndOfStreamException)
{
return null;
}
//Catch when the application is running a more privilaged socket than dotnet-monitor. For example, running a web app as administrator
//while running dotnet-monitor without elevation.
catch (UnauthorizedAccessException)
Expand Down