title: Visual Studio Code: Could not find the preLaunchTask 'build'?
body: <p>I have created a new .NET Core application with the command:</p>
  
  <pre><code>dotnet new console -o test
  </code></pre>
  
  <p>When I try to run it in the Visual Studio Code debugger, I get:</p>
  
  <pre><code>Could not find the preLaunchTask 'build'?
  </code></pre>
  
  <p>Visual Studio Code generated these files for me:</p>
  
  <pre><code>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": [ ],
              "isBuildCommand": true,
              "showOutput": "silent",
              "problemMatcher": "$msCompile"
          }
      ]
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>launch.json
  {
      "version": "0.2.0",
      "configurations": [
          {
              "name": ".NET Core Launch (console)",
              "type": "coreclr",
              "request": "launch",
              "preLaunchTask": "build",
              "program": "${workspaceRoot}/bin/Debug/&lt;target-framework&gt;/&lt;project-name.dll&gt;",
              "args": [],
              "cwd": "${workspaceRoot}",
              "stopAtEntry": false,
              "console": "internalConsole"
          },
          {
              "name": ".NET Core Launch (web)",
              "type": "coreclr",
              "request": "launch",
              "preLaunchTask": "build",
              "program": "${workspaceRoot}/bin/Debug/&lt;target-framework&gt;/&lt;project-name.dll&gt;",
              "args": [],
              "cwd": "${workspaceRoot}",
              "stopAtEntry": false,
              "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": "${workspaceRoot}/Views"
              }
          },
          {
              "name": ".NET Core Attach",
              "type": "coreclr",
              "request": "attach",
              "processId": "${command:pickProcess}"
          }
      ]
  }
  </code></pre>
  
  <p>My problem looks similar to <a href="https://stackoverflow.com/questions/35975641/could-not-find-the-prelaunch-task-build">this one</a>, but in my case there are no mismatches between the names in launch.json and tasks.json for the preLaunchTask so the answer does not apply in this case. I'm running Visual Studio Code version 1.11.2 and .NET Core 1.1 (latest versions as of when this post was created).</p>
  
  <p>I have tried the same on both a Windows machine and a Mac with the same problem. If I do the command "dotnet restore" and "dotnet run", the code runs with no problems, but I still get the same error: "Could not find the preLaunchTask 'build'"</p>