Attaching from within Visual Studio to the dotnet.exe process Debug – Attach to Process
This works fine, however to me seems too many clicks/steps to do efficiently.
I have used for many years an extension to make this much easier. There are a number of these ‘Attach To’ type extensions available. The one I am using right now is AnotherAttachToAny
Once installed, I then set keystroke shortcut keys to execute the above steps. This is how it is currently configured to me. You can see I have Alt-A setup to immediately attach to the w3process (IIS), and Alt-D attaches to dotnet.exe. This is one keystroke to attach to the running process and any breakpoints within my .net code are hit and I can then step through.
Configuration of this extension is done through Tools – Options – Another Attach To Any
Setting up a keystroke to one of the above commands is done through Tools – Options – Keyboard
This single extension has saved me hundreds of hours