If you're troubleshooting a web app hosted in IIS, and you're attaching a debugger like DebugDiag, for example, then sometimes you may encounter the below event (ID 5082) in the System Event Viewer logs:
A worker process with pid '###' that serves application pool ‘xyz' has been determined to be unhealthy (see previous event log message), but because a debugger is attached to it, the Windows Process Activation Service will ignore the error.
The source of this error is "WAS" which represents the Windows Process Activation Service. This is the service in-charge of starting, stopping, and keeping track of IIS worker processes, among other duties.
Typically, when an IIS worker process (w3wp.exe) is deemed "unhealthy," such as due to WAS health ping failures, startup/shutdown time limits being exceeded, etc., that specific process is terminated and at the same time another worker process is started to handle new requests. However, when a debugger is attached, the problematic process is allowed to continue running, and is not terminated like it normally would.
If you decide during troubleshooting that you want to disable this behavior and let WAS continue terminating the process like normal, but keep the debugger attached, you can set this registry value: