I get this annoying error from time to time for no apparent reason. Think it is a hard to find bug in VS Code C# environment (specifically in the OmniSharp extension) which triggers from time to time, and messes up the launch files in the .vscode folder. It may be triggered depending on how you create a C# project, seems that part of OmniSharp ceases to work and this triggers the problem. Looking closely in the OmbiSharp output console I do sometime get a note, that launch.json is locked, and thus cannot be modified, but most often OmniSharp fails without any message, I suppose there are various possible causes.
Anyway, I can always fix it by renewing the launch config files like this:
(1) In Code Explorer, delete the .vscode folder
(2) Open the Command Window (Shift-Ctrl-P) and execute Ominsharp: Restart Omnisharp
(3) Move the focus to any .cs file (if you have only one, move the focus to any other file and back)
After you focus the .cs file, down in the right corner of Visual Studio Code, a message must pop up telling you that "Required assets to build and debug are missing", hit "Yes" to get .vscode and its contents re-created. If you don't get the message, find out why not, note, it can be turned off and on through settings.
Run your project, it should re-create the .vscode folder and its files and should run fine from now on.
Note that there are variuos tipps on the net which tell you to modify launch.json or tasks.json by hand to get rid of the problem. While this may help if you are patient enough to do all the necessary changes by hand every time, this is a poor workaround. If OmniSharp does its job correctly, its doing all the modifications, if the modifications fail, clear the files and restart OmniSharp instead of messing with the files by hand.
Verified with VS Code 1.61.0 and OmniSharp 1.23.16 (latest versions as of Oct 2021)