how to use code runner in visual studio code for c# code example

Example 1: how to make a C# application visual studio code

mkdir MyApp; cd MyApp;
dotnet new console

Example 2: 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
            }
        }
    ]