1、需要安装 PowerShell 7 / Core (可使用命令行: dotnet tool install --global PowerShell --version 7.2)
2、需要安装 Visual Studio 扩展 Microsoft Child Process Debugging Power Tool 2022
3、安装插件后启动 Visual Studio,可以在 Debug -> Other Debugging Targets 中找到 Child Process Debugging Settings。
4、设置开启此项目的子进程调试
5、打开launchSettings.json文件项目调试属性设置
"dapr": {
"commandName": "Executable",
"executablePath": "pwsh",
"workingDirectory": ".",
"commandLineArgs": "-Command \"dapr run --app-id Servers1 --app-port 5001 --app-protocol grpc -- dotnet run --no-build\"",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"nativeDebugging": true,
"dotnetRunMessages": "true",
"applicationUrl": "http://localhost:5001"
}
最后只要启动项目
成功进入断点