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 为应用的进程名称

 

效果如下:

 

posted on 2022-09-02 11:37  不会非的猪  阅读(362)  评论(0编辑  收藏  举报

导航