Attach debugger to IIS?

Answered

Is it possible to attach the debugger to a running IIS instance?

 

With Visual Studio, I would select attach to process and then attach to "w3wp.exe". In Project Rider, "Attach to .net process" does not show w3wp.exe.

 

I have tried both Rider.exe and Rider64.exe in case it was an issue with the process being of a different architecture, didn't help.

10
10 comments

i wrote code in rider, debug in visual studio. haha

1

Have you tried running Rider as administrator? I don't think running as normal user would have permissions to attach to IIS.

1
Avatar
Permanently deleted user

That's a good idea, but unfortunately didn't help :(

When using Visual Studio the check box "show processes from all users" needs to be checked. Could that be related? On my system w3wp.exe is running under another user (eg: DefaultAppPool).

Rider should have permissions to debug another user's process as it's running as admin, but maybe the list just isn't showing it because it's not the current user and an option to show other users' processes could be added?

1
Avatar
Permanently deleted user

Running as administrator seems to work in the newest version 163.2518.

I was able to successfully attach to w3wp

1

My experience with debuging IIS. It works, but has some pitfalls. Here are the steps to follow:

1. Deploy to IIS manually in IIS UI
2. Run Rider as Administrator
3. Open your webapplication in browser, that will start w3wp.exe and load your webapplication.
4. Attach to w3wp.exe from Rider (via Run->Attach to local processes). If you have several pools in IIS, them there might be several w3wp.exe processes.
5. Set brakepoints
6. Reload page.

4

@Ivan Shakhov - How can i Identify between different w3wp processes?

they are all got the same name.

0

Thanks @Ivan - Still, I think you can agree with me that the AppPoolId of each w3wp should be part of Rider UI.

 Do you think I should open a bug for it? if so how do I do that?

 

0

Thanks @Ivan, appreciate your support!

0

Please sign in to leave a comment.