Solutions
This problem is solved in two steps:
- Adding Developer Command Prompt to Visual Studio Code
- Updating
"console"
field in the launch.json file.
1. Adding Developer Command Prompt to Visual Studio Code
If you create C# programs with the terminal or powershell that comes with Visual Studio Code, you will be using the old toolkit. In this case, launch.json and tasks.json files aren't created in the .vscode directory when you compile the project, and you cannot use the new features of the C# programming language through the old toolset (only C# 5.0 is supported). To add a new terminal to Visual Studio Code, use the Control Shift P shortcut and enter the command "Terminal: Select Default Profile"
. Click on the settings icon of any default terminal on the window that opens and name the new terminal profile "Developer Command Prompt".

To check that the operation was successful, use the Control Shift P shortcut to view the new terminal listed and enter the command "Terminal: Select Default Profile"
.

Use the Control Shift P shortcut and enter the "Preferences: Open Setting (JSON)"
command to open the setting.json file. You can view the newly added terminal information named "Developer Command Prompt" under "terminal.integrated.profiles.windows"
settings. Update this field below:
"Developer Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [
"/K",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\VsDevCmd.bat",
],
"icon": "terminal-cmd"
}
Open "Developer Command Prompt" and create new project:
> mkdir TestProject
> cd TestProject
> dotnet new console
To receive data input from the console while debugging, change the configuration in the launch.json file as follows:
"console": "integratedTerminal"
When you press the F5 button to debug the opened project, a panel will open to select the environment. Select ".NET 5+ and .NET Core" from this field. In this step, the .vscode directory (launch.json and task.json files) will be created.

Accept all suggestions by following the prompts at the bottom right of Visual Studio Code as the new toolset will be used for the first time on the system. At this stage, launch.json and task.json files will be created under the .vscode directory.

2. Updating "console"
Field In The launch.json
To receive data input from the console while debugging, change the configuration in the launch.json file as follows:
"console": "integratedTerminal"
3. Debugging On Test Project
Press F5 to debug the project:

References