Tasks are only available on a workspace folder?

Leighton B picture Leighton B · Oct 7, 2017 · Viewed 22.2k times · Source

Can't find an simple, basic solution anywhere for this problem so I figured it was worth posting it here.

When I go to run my code as a task, I get the following message: "Tasks are only available on a workspace folder" - I can't find a solution anywhere and I'm a beginner at Visual Studio Code so I might need the answer / solution explaining in more simpler terms.

VSC Version = 1.17.0

Answer

Suraj Rao picture Suraj Rao · Oct 7, 2017

Visual Studio Code treats the folder containing your program file as a workspace folder.

Your tasks created will be contained in a file tasks.json within a hidden folder .vscode inside your project or workspace folder.

So instead of opening the file directly to create a task, you need to open the folder as a project.