Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code 在VS代码中链接启动前任务_Visual Studio Code_.net Core - Fatal编程技术网

Visual studio code 在VS代码中链接启动前任务

Visual studio code 在VS代码中链接启动前任务,visual-studio-code,.net-core,Visual Studio Code,.net Core,是否可以使用VS代码调用多个启动前任务 我尝试恢复包,然后构建,然后运行,但我只能配置构建 My launch.json: { "name": ".NET Core Launch (console)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "${workspaceRoot}/src/myProject

是否可以使用VS代码调用多个启动前任务

我尝试恢复包,然后构建,然后运行,但我只能配置构建

My launch.json:

{
        "name": ".NET Core Launch (console)",
        "type": "coreclr",
        "request": "launch",
        "preLaunchTask": "build",
        "program": "${workspaceRoot}/src/myProject/bin/Debug/netcoreapp1.0/myProject.dll",
        "args": [],
        "cwd": "${workspaceRoot}/src/myProject",
        "stopAtEntry": false,
        "externalConsole": false
    },
My tasks.json:

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
    {
        "taskName": "build",
        "args": [
            "./**/project.json"
            ],
        "isBuildCommand": true,
        "showOutput": "always",
        "problemMatcher": "$msCompile"
    }
]
}


因此,我尝试指定
dotnet restore
命令,但它不起作用。

您如何配置任务?我将启动前任务:“build”作为默认值,当您收到创建launch.json的提示时生成。但是,我不知道该参数是否可以接受多个任务,或者您是否可以在tasks.json中定义依赖项,以便我可以运行restore Previor build。这有意义吗?我也尝试过在任务的参数中这样做:“dotnet restore&&dotnet build”,但我无法让它工作。你能发布你的
project.json
和任何其他相关配置文件吗?我通过添加launch.json和tasks.json编辑了我的问题