When you enable the DevToolsPlugin and you run devproxy, the execution fails with an exception
Expected behaviour
The browser configured in the devproxyrc.json file starts up with the Developer Tools turned on, showing the requests intercepted by Dev Proxy
Actual behaviour
DevProxy fails to launch with the following exception
Unhandled exception. System.ComponentModel.Win32Exception (0x80004005): Unable to enumerate the process modules.
at System.Diagnostics.NtProcessManager.GetModules(Int32 processId, Boolean firstModuleOnly)
at System.Diagnostics.NtProcessManager.GetFirstModule(Int32 processId)
at Microsoft.DevProxy.Plugins.Inspection.DevToolsPlugin.<>c__DisplayClass10_0.<GetBrowserProcesses>b__0(Process p)
at System.Linq.Enumerable.WhereArrayIterator`1.ToArray()
at Microsoft.DevProxy.Plugins.Inspection.DevToolsPlugin.GetBrowserProcesses(String browserPath)
at Microsoft.DevProxy.Plugins.Inspection.DevToolsPlugin.InitInspector()
at Microsoft.DevProxy.Plugins.Inspection.DevToolsPlugin.Register()
at Microsoft.DevProxy.PluginLoader.LoadPlugins(IPluginEvents pluginEvents, IProxyContext proxyContext)
at Program.<Main>$(String[] args)
at Program.<Main>(String[] args)
Steps to reproduce
1) Open devproxyrc.json and add the DevToolsPlugin in the plugins section:
The issue is happening in the following code of the DevToolsPlugin.cs file. The problem seems to be with the method which enumerates the running processes.
private Process[] GetBrowserProcesses(string browserPath)
{
return Process.GetProcesses().Where(p =>
p.MainModule is not null && p.MainModule.FileName == browserPath
).ToArray();
}
Description
When you enable the DevToolsPlugin and you run devproxy, the execution fails with an exception
Expected behaviour
The browser configured in the devproxyrc.json file starts up with the Developer Tools turned on, showing the requests intercepted by Dev Proxy
Actual behaviour
DevProxy fails to launch with the following exception
Steps to reproduce
1) Open devproxyrc.json and add the DevToolsPlugin in the plugins section:
2) At the end of the file, add a section to define the configuration:
3) Launch DevProxy 4) Observe the exception being triggered
Dev Proxy Version
0.19.1
Operating system (environment)
Windows
Shell
PowerShell
Configuration file
Additional Info
The issue is happening in the following code of the DevToolsPlugin.cs file. The problem seems to be with the method which enumerates the running processes.