vs code ${file} tasks not working code example

Example: vs code run and build task c#

"tasks": [
        {
            "label": "build",
            "command": "dotnet",
            "type": "shell",
            "args": [
                "build",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary"
            ],
            "group": "build",
            "presentation": {
                "reveal": "silent",
                "echo": false
            },
            "problemMatcher": "$msCompile"
        },
        {
            "label": "run",
            "dependsOn": ["build"],
            "command": "dotnet",
            "args": [
                "run"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "reveal": "always",
                "echo": false
            }
        }
    ]