Reputation: 503
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.
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://learn.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
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.
Upvotes: 1
Views: 2129
Reputation: 28322
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:
3.Then you could open Visual studio’s tool menu and click options.
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
5.On the remote server click the server default page and find the worker processes.
6.Browser the web application which you want to remote debug
7.Open the worker processes it will show the process ID. You should remember it.
8.Open the visual studio’s debug view and click attach to process.
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.
If connect successfully, the msvsmon will show connected log.
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.
Upvotes: 4