0
votes

I want to debug an deployed MVC application in Visual studio.

Web server is Windows Server 2019 and MVC application published in IIS web server in this machine.

We will access MVC application through custom domain url.

I want to debug deployed MVC application in another local development computer (Windows 10 OS) where visual studio 2019 installed.

I have followed the below articles for enabling remote debugging.

https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugger-port-assignments?view=vs-2019

Enabled the Discovery Port UDP 3702 in Windows server 2019 where the MVC app deployed in IIS.

Installed the remote debugging tools for VS 2017 in remote windows server 2019 following the below article.

https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging?view=vs-2019

I tried to connect to remote computer from VS 2019 of local development computer following below article

https://docs.microsoft.com/en-us/visualstudio/debugger/attach-to-running-processes-with-the-visual-studio-debugger?view=vs-2019#BKMK_Attach_to_a_process_on_a_remote_computer

But I'm unable to find remote webserver (Where MVC app deployed) in Connection target of VS Attach Process

Requirement:

In different development machine where VS 2019 installed, I want to debug MVC application which is deployed through IIS in another windows server 2019.

Note: In remote windows server 2019, multiple MVC apps has been deployed to IIS. In development machine, I want to just browse MVC app through custom domain url and debugging should start in Visual studio 2019.

Even I'm not getting, how to connect to single deployed MVC app remotely and attach debugger to it from development VS 2019 from development machine, since multiple MVC apps deployed in remote web server and I want to remote debug only particular MVC application.

Kindly let me know, how can I acheive this.

1

1 Answers

2
votes

If you want to know how to remote debug the MVC application in VS , you could refer to below steps:

1.Copy remote debug folder to remote server's path:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Remote Debugger\x64

Notice: Please click configure remote debugging, if it show notice window

Msvsmon:

enter image description here

enter image description here

  1. Publish the project with the debug mode to remote server

enter image description here

3.Then you could open Visual studio’s tool menu and click options.

enter image description here

4.Find debugging and select symbols. Then should find your local project’s bin folder path and add it into the symbol file locations as below:

Example: C:\Users\xxxx\source\repos\WebAPIRemoteDebugTest\WebAPIRemoteDebugTest\bin

enter image description here

5.On the remote server click the server default page and find the worker processes.

enter image description here

6.Browser the web application which you want to remote debug

enter image description here

7.Open the worker processes it will show the process ID. You should remember it.

enter image description here

8.Open the visual studio’s debug view and click attach to process.

enter image description here

9.Type in the server IP address or server name when you run the msvsmon and click find, it will show all the process which run on the server. You could search the processed which show in the worker process we have found in IIS.

enter image description here

If connect successfully, the msvsmon will show connected log.

enter image description here

10.Then you could debug your codes as local VS application . Add breakpoint at the codes which throw the error and use postman reproduce this issue.

enter image description here