Problem Description:
Error "Unable to attach to process, one debugger attached" when attaching to process to debug IIS process (w3wp.exe) using vs2017-> Debug
In order to solve this problem took a lot of time, on the internet to find a lot of information, tried 7, 8 methods are invalid. Finally, the following method is used to solve the problem, for everyone's reference.
Interim workaround:
1 Installing the Debug Diagnostic Tool,
2 Start "DebugDiag 2 Collection"
3 Find W3wp.exe in the Process tab, right-select Detach debugger
Reason:
I installed the debug Diagnostic Tool before this machine, this application contains a service program DbgSvc.exe, and a debugger DbgHost.exe, The service program DbgSvc.exe is automatically started by default, and as a result, when this service is started, the debugger DbgHost.exe is appended to the IIS process by default
A thorough solution:
Set the startup type to manual for the Service Debug Diagnostic service (DbgSvc.exe) so that the service is not started by default and starts when needed
VS2017 debugger cannot attach to IIS process (w3wp.exe)