I was facing this issue where i was not able to debug the application which is on server, here i am adding step by step instruction how to achieve remote debugging working.
Step 1. Make Sure Server or Machine from where your application is deployed is having same .net Frame work which you are having on your local system
Step 2. If same Frame work is available then go to your local system path "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE"
inside this
One Folder will be present Name "Remote Debugger" copy that entire folder and paste on your Server system.
step 3. Coping the folder is not any location specific just copy anywhere if copying any where is not working then copy it to the "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE"
this path. this folder will have folders
As per your requirement For 64 Bit system use x64 And For 32 Bit system use x86 Folder. others remove
Step 4. Once you done with copy open the specific folder which you kept as per system configuration, Example : I am having 32 bit system will go inside x86 Folder. and open the exe called "msvsmon.exe" file as administrator.
Step 5. once you open it will show the following window now you are able to connect and debug the remote machine.
Configure Authentication Mode :
For this step refer the below link https://www.codeproject.com/articles/38132/remote-iis-debugging-debug-your-asp-net-applicatio
Step 6. Open the Visual studio on local machine which will have same version of code which is available on the server machine which you want to debug.
Step 7. Once you open the Visual studio got to the debug -> Attach to Process
Step 8. Once you click on the Attach to process window will get open on the window in qualifier select your server name. once u select that you will see all process of that system below
in that list select "W3svc"
service name and click on attach.
Step 9. Put break point on the line of code which you want to debug it will hit when application will run which is hosted on server.