Remotely debugging IIS in Visual Studio
Sometimes you need to debug an IIS site on a remote server.
- Install Remote Tools for Visual Studio on the server
- Open port 4024 so that you can access from your pc
- Run Remote Debugger as an administrator
- Open Visual Studio with a copy of the codebase
- Click Debug -> Attach to Process
- Enter the remote server name as the target
- Click Refresh
- Make sure Show processes from all users is selected
- Select the process you want to debug and select Attach
See this post to get the id of the correct process.
The remote debugger will not pass the symbols from the remote server to the debugger which means your breakpoints will not be hit.
To load them
- Copy the pdb files of the assemblies you want to debug to your local machine
- In visual studio open the modules window while debugging, Debug -> Windows -> Modules
- Right click on the module that isn’t loaded and select Load Symbols
- Select the pdb files you copied from the server
Once you select the pdb files to load your breakpoints will then be hit.