在Visual代码中,单击测试项目中的“调试测试”代码透镜链接:
结果会出现错误消息:
MSBUILD : error MSB1011: Specify which project or solution file to use
because this folder contains more than one project or solution file.
错误消息是有意义的,确实有几个项目可供选择,但如何将调试器指向正确的项目?
我尝试更改我的构建任务在.csproj中指向的tasks.json文件,但是它没有任何效果。一个快速的google打开了用于调试的通用VSCode文档,但我找不到如何为“调试测试”事件配置构建任务。
发布于 2018-08-01 22:56:35
我相信您需要在vscode tasks.json和launch.json中设置测试项目和其他引用层。
发布于 2018-08-11 22:26:54
您可以通过路径指定显式项目或解决方案文件,将其作为最后一个参数传递给构建args。
它可能是项目.csproj或解决方案.sln文件。
MSBuild.exe开关
样本tasks.json:
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "msbuild",
"args": [
// Ask msbuild to generate full paths for file names.
"/property:GenerateFullPaths=true",
"/t:build",
"solution_file.sln"
],
"group": "build",
"presentation": {
// Reveal the output only if unrecognized errors occur.
"reveal": "silent"
},
// Use the standard MS compiler pattern to detect errors, warnings and infos
"problemMatcher": "$msCompile"
}
]
https://stackoverflow.com/questions/47016161
复制相似问题