Here are the steps for enabling remote debugging using Visual Studio 2015 Update 3.
Note: This is for asp.net web application using Visual Studio 2015 update 3, IIS 8.5, asp.net 4.5. So, it may or may not work for other versions of .Net apps.
- Code deployed on remote server (on a different domain)
- Source code and visual studio running on your local machine.
On the remote server:
- Deploy the code (bin should have exact same pdb files as that of local) on the remote server.
- Install the remote debugging tools on the server. Here is the link for VS 2015 update 3 - remote debug tools for VS 2015 update 3. But you will have to use the exact one for the VS version you have.
- Need to have admin permissions on the remote server. Run the debugger as administrator (Important! - otherwise when we connect from Visual Studio, we cannot connect to the w3wp).
On the local machine:
- (Do not build because then your dll/pdbs will be different from those deployed on the remote server)
- In the Visual Studio menu, click Debug -> Attach to Process. On the window select "Default" in the Transport box. (If on the remote debugger options on the remote server, you have any user selected, you can select Remote (no authentication) here).
In the Qualifier, type in the IP, port number as shown on the remote debugger. If the remote server is on different domain, it should prompt for username and password. I had problem for one day where it was not giving me the prompt for username and password to the remote server. I am still not sure how it started prompting after a day. I did clean up credential manager, reinstall VS 2015 but nothing seemed to help a day before.
- Need to check "Show processes for all users" because w3wp process may run under different account than the user account you are using to connect to remote server.
- Always should attach to w3wp and we can connect ONLY if the remote debugger is running as "administrator"
- Set break point in code
- Open the browser and go to the url. The break point should hit.
Other notes:
- In the Debug-options-symbols menu options window, I did set the symbols as explained on other articles but did not make any difference in this case.
Hope this helps. Please feel free to comment if you run into issues. Good luck!!
No comments:
Post a Comment