Visual Studio Code : The 'C#' extension is recommended for this file type

To manually install the correct c# extension, do the following:

  • Uninstall existing vscode C# plugin
  • Close vscode
  • Download the vsix 1.21.12 from here
  • Open a command line in the folder where the vsix is.
  • Type: code --install-extension .\csharp-1.21.12.vsix

You should see:

Installing extensions...
Extension 'csharp-1.21.12.vsix' was successfully installed.

Open VSCode and in the C# output window, you will see:

Installing C# dependencies...
Platform: win32, x86_64

Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' (32544 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'

Errors should now have gone away.


That was a mistake by Microsoft. I just spent hours to solve the problem and noticed that actually the name of the plugin was recently changed, leading to the error. We can fix it by manually downloading a previous version of the plugin. Link:https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp&ssr=false#review-details