VS Code: Defining tasks.json for debugging

As a beginner to FSharp I am trying to setup VS Code on MacOS for debugging.
I have followed the instructions on Ionide
I have VS Code, with the OmniSharp and Ionide plugins.

I also looked at these instructions: Debug F# in Visual Studio Code on OSX (and Linux?) targeting dotnet core · GitHub

My launch.json looks like this:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/net7.0/ProjectName.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "console": "internalConsole"
        }
    ]
}

Now I’m trying to configure the “preLaunchTask”: “build”.
I press Cmd-Shift-P and select:

Tasks: Configure Task

I then select this from the list:

Build: ProjectName.fsproj
Build the ProjectName.fsproj project using dotnet build

This results in the following tasks.json:

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "msbuild",
			"problemMatcher": [
				"$msCompile"
			],
			"group": "build",
			"label": "Build: ProjectName.fsproj",
			"detail": "Build the ProjectName.fsproj project using dotnet build"
		}
	]
}

Note that this file does not have a task with label build.

Now I choose Run > Start Debugging and the message comes up: Could not find the task ‘build’.
I can then choose:

  • Debug anyway (this does work)
  • Configure task. This brings me to a previous dialogue: “Select a task to configure”.

So my question is: How do I configure my task? The page referred to above suggests to select .NET Core from the task configuration list, but I do not see this option.

You can choose “create task from template” (not sure if I remember the wording correctly) and then .Net build.