VS代码错误:preLaunchTask'build'以退出代码1终止

时间:2018-02-28 01:42:38

标签: c# html asp.net-mvc asp.net-core visual-studio-code

我在Visual Studio Code中使用ASP.NET创建了一个代码,但我不知道如何在VS Code上调试代码,因为这个错误preLaunchTask'build'以退出代码1终止。

这是我的launch.json

    {
    "version": "0.2.0",
    "configurations": [
    {
    "name": ".NET Core Launch (console)",
    type": "coreclr",
    request": "launch",
    "preLaunchTask": "build",
    "program": "${workspaceFolder}/bin/Debug/<insert-target-framewor here>/<insert-project-name-here>.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "internalConsole",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "name": ".NET Core Launch (web)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "internalConsoleOptions": "openOnSessionStart",
            "launchBrowser": {
                "enabled": true,
                "args": "${auto-detect-url}",
                "windows": {
                    "command": "cmd.exe",
                    "args": "/C start ${auto-detect-url}"
                },
                "osx": {
                    "command": "open"
                },
                "linux": {
                    "command": "xdg-open"
                }
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "sourceFileMap": {
                "/Views": "${workspaceFolder}/Views"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ]
}

我的tasks.json

{

"version": "2.0.0",
"tasks": [
    {
        "label": "build",
        "command": "dotnet build",
        "type": "shell",
        "group": "build",
        "presentation": {
            "reveal": "silent"
        },
        "problemMatcher": "$msCompile"
    }
]

}

我怎么解决这个问题?这是我学校的家庭工作,有人可以帮助我吗?

0 个答案:

没有答案