.net core 使用VSCode任务运行dotnet时出现问题

.net core 使用VSCode任务运行dotnet时出现问题,.net-core,visual-studio-code,vscode-tasks,.net Core,Visual Studio Code,Vscode Tasks,我在父文件夹中有两个项目: parentFolder | webApiFolder | testsFolder 使用终端,我需要将--project参数传递给dotnet run。因此,我认为创建一个任务并运行该任务会更容易。然而,我无法让这项任务发挥作用 任务: 输出: > Executing task: C:\Program Files\dotnet\dotnet.exe run --project G:\Git_CS\mercury-ms-auth\WebApi\mer

我在父文件夹中有两个项目:

parentFolder
   | webApiFolder
   | testsFolder
使用终端,我需要将
--project
参数传递给
dotnet run
。因此,我认为创建一个任务并运行该任务会更容易。然而,我无法让这项任务发挥作用

任务:

输出:

> 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
一种解决方案是
“键入”:“shell”
并传递整个命令

{
    "label": "run api",
    "command": "dotnet run --project ${workspaceFolder}\\WebApi",
    "type": "shell",
    "problemMatcher": "$msCompile"
}

很好,很管用。好电话。令人沮丧的是,另一种方法应该有效,但我会使用它。
{
            "label": "test with code coverage",
            "command": "dotnet",
            "type": "process",
            "args": [
                "test",
                "${workspaceFolder}/Tests/Tests.csproj",
                "/p:CollectCoverage=true",
                "/p:CoverletOutputFormat=cobertura"
            ],
            "problemMatcher": "$msCompile"
        }
{
    "label": "run api",
    "command": "dotnet run --project ${workspaceFolder}\\WebApi",
    "type": "shell",
    "problemMatcher": "$msCompile"
}