Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tasks are only available on a workspace folder?

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

like image 959
Leighton B Avatar asked Oct 07 '17 09:10

Leighton B


People also ask

What is included in your workspace folder?

A Visual Studio Code workspace is a list of a project's folders and files. A workspace can contain multiple folders. You can customize the settings and preferences of a workspace.

Where are vs workspaces stored?

Workspace settings as well as debugging and task configurations are stored at the root in a .vscode folder. You can also have more than one root folder in a VS Code workspace through a feature called Multi-root workspaces.

What is a workspace in Visual Studio Code?

A Visual Studio Code "workspace" is the collection of one or more folders that are opened in a VS Code window (instance).

Where is workspace settings in VS Code?

Settings Scope Workspace Settings: Apply to the current project only. They are stored in <<workspace>>/. vscode/settings.


1 Answers

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.

like image 133
Suraj Rao Avatar answered Sep 21 '22 12:09

Suraj Rao