Debugger detach


I am debugging a project that runs under IIS and ASP.NET. Each time the debugger is restarted, it is terribly slow to start up. In VSS, one can detach the debugger from the running IIS process, rebuild changes, and then re-attach the debugger to IIS for a faster turnaround time. I see that Rider has an option to Attach, but no option to Detach.


"Stop" does Detach, which is weird, but seem to work. Also "Rerun" does Attach again.


On my version of Rider (version info below), Stop does not Detach. It completely closes IIS.

Rider 1.0 EAP
Build #RS-163.8671, built on November 21, 2016
Rider EAP User
Expiration date: December 21, 2016
JRE: 1.8.0_112-release-408-b2 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

IIS may stop by itself in some cases.

But Rider doesn't stop it. I made a small recording

1. Rebuld Solution

2. Reload page

3. Attach to w3wp.exe

4. Reload Page

Stop at brakepoint.

5. Continue

6. Stop (detaches)

7. Make change in code. Rebuild.

8. Rerun (Re-attaches)

9. Reload page

Stop at brakepoint.

10. Stop

Check that w3wp.exe is alive.


@Ivan Shakhov, in your recording, you don't show how you started IIS in the first place. You simply attach your debugger to an already running instance. In my case, when I start the debugger, it starts IIS. When I stop the debugger, it stops IIS. Did you start IIS before starting the debugger?

I was able to achieve a similar effect as shown in your video by using "Run" to start IIS, and then using Run, "Attach to Local Process" to connect the debugger to the IIS process started by Run. This doesn't seem to be what you did though -- I see no "Run" in your screencast.


@Raman Gupta, for me step 2. (Reload page ) starts w3wp.exe.


@Ivan Shakhov Reload page?? But how did you load the page in the first place? You're not going to tell me you loaded the page without any server present :-)


@Raman Gupta, I have configured the website in IIS manually via IIS Manager.

And how do you configure IIS?


> @Raman Gupta, I have configured the website in IIS manually via IIS Manager.

I guess that is the difference. I'm letting Rider start up IIS Express and install the application into it on its own, just like Visual Studio does. I don't even have IIS Manager installed -- I don't believe IIS Express even has an IIS Manager.

Given this discussion, the better way to run the application when letting the IDE start IIS Express seems to be to use the "Run" capability, and then attach the debugger using the "Attach to Process" mechanism mentioned above. Run does seem to automatically pick up changes after builds, which means that IIS does not need to be restarted when changes are made to the source. This does seem to be a bit faster than a complete restart.


Please sign in to leave a comment.