vs2022 调试 dapr
基础环境:
Windows 11 专业版
Microsoft Visual Studio Enterprise 2022 (64 位) - Preview
引用:
思路: https://github.com/dapr/dotnet-sdk/issues/401#issuecomment-747563695
示例:https://github.com/dapr/quickstarts/tree/master/state_management/csharp/http
实践:
1.倾向于使用vs的扩展
需要安装 PowerShell 7 / Core (可使用命令行:dotnet tool install --global PowerShell
)
需要安装 Visual Studio 拓展
Microsoft Child Process Debugging Power Tool 或
Microsoft Child Process Debugging Power Tool 2022
1.1 下载引用的dapr的quickstarts
能在示例项目下看到readme
dapr run --app-id order-processor --components-path ../../../components/ -- dotnet run
注意此处可以指定 components
1.2 项目的属性-调试
保存后会自动生成文件 launchSettings.json
launchSettings.json 内容也可以通过文件直接修改,效果等同,文件如下:
{ "profiles": { "Program": { "commandName": "Executable", "executablePath": "pwsh", "commandLineArgs": "-Command \"dapr run --app-id order-processor --components-path ../../../components/ -- dotnet run
", "workingDirectory": ".", "nativeDebugging": true } } }
1.3 配置拓展
Program.exe 为应用的进程名称
效果如下:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)