在Visual Studio Code中,单击我的测试项目中的“debug test”代码镜头链接:
导致错误消息:
MSBUILD : error MSB1011: Specify which project or solution file to use
because this folder contains more than one project or solution file.
错误信息是有道理的,确实有几个项目可供选择但是 how do I point the debugger at the correct one?
我尝试更改我的构建任务在tasks.json中指向的.csproj文件,但它没有任何效果 . 一个快速谷歌出现了一般的VSCode文档进行调试,但我不知道如何为“调试测试”事件配置构建任务 .
2 回答
我相信你需要在vscode tasks.json和launch.json中设置测试项目和其他引用的层
您可以通过路径将项目或解决方案文件显式指定为构建args作为最后一个参数 .
它可能是项目 .csproj 或解决方案 .sln 文件 .
MSBuild cli reference
示例tasks.json: