.NET远程调试 Web Api 项目

一、服务器设置

1.发布调试项目

.NET 远程调试 MVC/Web Api 项目

把要调试的网站以Debug发布到服务器上

.NET 远程调试 MVC/Web Api 项目

作者的项目叫DMP

2.把调试工具复制到服务器上运行

.NET 远程调试 MVC/Web Api 项目

从本地把C:\ProgramFiles (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Remote Debugger文件夹复制到服务器上

.NET 远程调试 MVC/Web Api 项目

在服务器Remote Debugger目录下找到msvsmon.exe双击运行

.NET 远程调试 MVC/Web Api 项目

点击Configure remote debugging

.NET 远程调试 MVC/Web Api 项目

正确启动

二、客户端设置

.NET 远程调试 MVC/Web Api 项目

Visaul studio中设置好断点,点击调试=>附加到进程

.NET 远程调试 MVC/Web Api 项目

点击允许访问

.NET 远程调试 MVC/Web Api 项目

在连接目标处填写服务器的地址=>回车

.NET 远程调试 MVC/Web Api 项目

此对话框中输入远程登录服务器的windows账号密码

.NET 远程调试 MVC/Web Api 项目

附加到IIS AppPool\DMP进程

.NET 远程调试 MVC/Web Api 项目

点击附加

使用web api测试工具调用服务器接口

.NET 远程调试 MVC/Web Api 项目点击Try it out!

.NET 远程调试 MVC/Web Api 项目

正确的命中断点

.NET 远程调试 MVC/Web Api 项目

接口正确返回数据

参考文章

https://msdn.microsoft.com/zh-cn/library/y7f5zaaa.aspx

 

相关文章: