【发布时间】:2019-11-07 14:43:29
【问题描述】:
我在父文件夹中有两个项目:
parentFolder
| webApiFolder
| testsFolder
使用终端,我需要将--project 参数传递给dotnet run。因此,我认为只创建一个任务并运行该任务会更容易。但是,我无法完成任务。
任务:
{
"label": "run api",
"command": "dotnet",
"type": "process",
"args": [
"run",
"--project ${workspaceFolder}\\WebApi\\mercury-ms-auth.csproj"
],
"problemMatcher": "$msCompile"
}
输出:
> Executing task: C:\Program Files\dotnet\dotnet.exe run --project G:\Git_CS\mercury-ms-auth\WebApi\mercury-ms-auth.csproj <
Couldn't find a project to run. Ensure a project exists in g:\Git_CS\mercury-ms-auth, or pass the path to the project using --project.
The terminal process terminated with exit code: 1
但是,如果我运行 dotnet run --project G:\Git_CS\mercury-ms-auth\WebApi\mercury-ms-auth.csproj,则可以完美启动项目。
同样,我的test and code coverage 任务也完美运行:
{
"label": "test with code coverage",
"command": "dotnet",
"type": "process",
"args": [
"test",
"${workspaceFolder}/Tests/Tests.csproj",
"/p:CollectCoverage=true",
"/p:CoverletOutputFormat=cobertura"
],
"problemMatcher": "$msCompile"
}
【问题讨论】:
标签: .net-core visual-studio-code vscode-tasks