Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

So I recently installed visual studio code and added the C# available extensions. I also installed the Unity Debugger but it won't work because "it depends on an unknown 'ms-vscode.csharp' extension", I tried searching for this 'ms-vscode.csharp'in the extensions bar but found nothing. whenever i open a C# file from Unity or from any folder it recommends me to install that uknown C# extensions. what can i do please? here is a picture of the message:

enter image description here

like image 985
Mounir Avatar asked Mar 07 '20 02:03

Mounir


People also ask

Is Visual Studio Code good for C?

Although a full-blown version of Visual Studio, such as Visual Studio Community Edition, can be great tool for doing C and C++ coding, there are many times when it can be overkill. With the addition of the C/C++ extension to Visual Studio Code, you might have what is needed in a small, cross-platform editor.

Is there C in Visual Studio?

Visual Studio Code is a lightweight, cross-platform development environment that runs on Windows, Mac, and Linux systems. The Microsoft C/C++ for Visual Studio Code extension supports IntelliSense, debugging, code formatting, auto-completion.

Why C is not working in VS Code?

You have to change it so it runs in the terminal. Go to the menu Code > Preferences > Settings. In the User tab on the left panel, expand the Extensions section. Find and select Run Code Configuration.

Can I compile C in Visual Studio?

The Visual Studio build tools include a C compiler that you can use to create everything from basic console programs to full Windows Desktop applications, mobile apps, and more.


1 Answers

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.

like image 113
Dr Rob Lang Avatar answered Sep 30 '22 23:09

Dr Rob Lang