C# intellisense not working in VS Code

Lost picture Lost · Jan 3, 2018 · Viewed 12.7k times · Source

I am using Visual Studio Code and I have already loaded C# OMNISharp plugin to my system and it works all fine in my existing project/solutions.

However, I just created a new solution and a new project in Visual Studio code and it sounds like for this particular solution, the Intellisense or any other Omnisharp features are just not working. I have tried following things:

  • Restarting Visual Studio Code
  • Disabling and enabling my OmniSharp Plug-in

Also, one thing that I noticed is that when a solution is created in Visual studio, it has a lot of code which looks like following:

Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AEA16303-6991-4FF1-A3A9-72D892D7968C}"
EndProject

Basically, these are all project references. However, when a solution is created by Visual Studio Code then there is not any section like that. This solution runs and compiles fine, just that it looks fundamentally different than how a Visual Studio solution looks like.

However, nothing seems to be working. Is there anything that I can try to make it work? Any ideas ?

Answer

5377037 picture 5377037 · Jan 16, 2018

It's caused by adding *.sln and *.csproj to your "files.exclude" setting.

Try this:

Code -> Preferences -> Settings -> "omnisharp.useMono": true/false

Remove from setting file.

Or, Open your project with MonoDevelop or Visual Studio 2015/2017 first, then reopen VS-Code.


Edit 1: Try setting "omnisharp.useGlobalMono": never and then restarting the omnisharp server. Credit: The_Wolf and kao peter