最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Debug .NET Core on Ubuntu using SSH with attach to process not hit breakpoint - Stack Overflow

programmeradmin2浏览0评论

I write an ASP.NET Core app, copy the source code to Ubuntu and build it, then use dotnet command to run it. Then attach process by SSH in Visual Studio 2022, no errors appear, no information in the output of debug in vs, and the module is empty.

Breakpoint is not hit when I call the API, the stop debug button shows, but it works well in my local PC environment. The below screenshot shows that process info in Ubuntu and Debug state in vs.

It has pdb files because I build the source code in Ubuntu, vs-debugger already installed (the first screenshot shows vs-debugger/GetvsDbg.sh -v vs2022 -u)

I think the issue is the vs-debugger command /bin/sh /home/smodev/.vs-debugger/GetVsDbg.sh -v vs2022 -u -l /home/smodev/.vs-debugger/vs2022 -d vscode -a /remote_debugger and /home/smodev/.vs-debugger/vs2022/vsdbg --interpreter=vscode, it didn't communicate to visual studio.

I write an ASP.NET Core app, copy the source code to Ubuntu and build it, then use dotnet command to run it. Then attach process by SSH in Visual Studio 2022, no errors appear, no information in the output of debug in vs, and the module is empty.

Breakpoint is not hit when I call the API, the stop debug button shows, but it works well in my local PC environment. The below screenshot shows that process info in Ubuntu and Debug state in vs.

It has pdb files because I build the source code in Ubuntu, vs-debugger already installed (the first screenshot shows vs-debugger/GetvsDbg.sh -v vs2022 -u)

I think the issue is the vs-debugger command /bin/sh /home/smodev/.vs-debugger/GetVsDbg.sh -v vs2022 -u -l /home/smodev/.vs-debugger/vs2022 -d vscode -a /remote_debugger and /home/smodev/.vs-debugger/vs2022/vsdbg --interpreter=vscode, it didn't communicate to visual studio.

Share Improve this question edited Mar 17 at 8:30 oudi asked Mar 17 at 7:04 oudioudi 6775 silver badges13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Summarize the issue:

OP has verified the issue is related to the vs2022 in his machine.

Suggestion

Upgrade the vs2022 to the latest version.


Please refer this official document: Debug .NET Core on Linux using SSH by attaching to a process first.

And I am not using vs-debugger.

Please make sure again that all files and contents of the two projects are the same. You can copy the project in Windows and transfer it to the Ubuntu machine by using WinSCP.

Test Steps

In addition, please confirm whether the URL address you visited is correct and whether this method is not triggered.

发布评论

评论列表(0)

  1. 暂无评论