How can I specify the .NET version in VSCode's tasks.json file?

26 views Asked by At

I have both .NET 9 preview and .NET 8 installed. Right now .NET 9 preview version is selected as the default.

I've learned that I can use global.json to specify the .NET version in command line, but the tasks.json file in VSCode doesn't recognize global.json and still uses the preview version as the build task. What am I doing wrong? Here's my generated tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "dotnet",
            "task": "build",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [],
            "label": "dotnet: build"
        }
    ]
}
0

There are 0 answers