2

I am working on vs code. When I open any folder the IntelliSense is not working when I hover the mouse over any text. It was working before but now I don't know why it's not working. Kindly help... imagereference

JHBonarius
  • 10,824
  • 3
  • 22
  • 41

4 Answers4

11

Solution 1 :

  1. Ctrl+Shift+P
  2. Write "OmniSharp: Select Project" and press Enter.
  3. Choose the solution workspace entry.
  4. Then enable the C# extension for "OmniSharp : Project"

Solution 2 :

  1. Selecting a project.json-file is opening a DNX-project and VSCode will load that project plus the referenced projects.

  2. Selecting a *.sln-file is opening a MSBuild-project. It will load the referenced *.csproj-projects and sibling or descendant project.json-files but no other project files that are referenced from the solution file.

  3. Selecting a folder will make VSCode scan for *.sln and project.json files and VSCode will attempt to load them all. More info see: https://github.com/OmniSharp/omnisharp-vscode/issues/1889

Solution 3:

  1. Download C# v1.24.0 extension can fix the IntelliSense for you

Solution 4: For bootstrap and HTML IntelliSense, add the following extensions:


NOTE : All solutions need to close your VS and reopen it again.

shA.t
  • 16,580
  • 5
  • 54
  • 111
Fadi
  • 585
  • 4
  • 22
2

For me solution 2 worked. C# IntelliSense did not work with C# Extension v1.25.0. Solution involved:

  1. Download the old version of C# Extension 1.24.4 vsix
  2. Install vsix manually to VS Code:
  • Open VS Code.

  • Open the “Extensions” sidebar (you can use “Ctrl+Shift+X”).

  • Click on the ellipsis icon in the top right corner of the menu.

  • Select “Install from VSIX…” VS Code will open a document browser.

  • VS Code will now begin the installation process of the extension.

This happened to me on 2 separate machines

  • You dont need to use vsix, just install older version from standard extensions dialog – Mic Aug 29 '22 at 21:09
0
using namespace.for.Book;

Instead of automatically assuming a broken installation, lets start with something incredibly basic.

Book is probably a custom class you've created that you've not imported.

Tertiary to this, I've noticed that autocomplete doesn't work for List objects unless I have "using System.Collections.Generic;" as part of my imports. Why? I've honestly no clue why it will allow my to use a List without erroring but then be completely unable to find the inferred types for autocomplete, most likely a performance based (intentional) limitation to the autocomplete to reduce the amount of data it has to pull up.

Hope this helps because I certainly couldn't find this solution, just blundered my way into it.

(This is an educated guess based on the fact that the only portion of text in your code that can bring up another class that's not built-in is Book)

Michael C.
  • 31
  • 3
0

This question was one of the first search hits for me when I noticed IntelliSense had stopped working for C# in VSCode for me.

I'm posting my experience here in the hopes it will resolve the problem for someone else.

I figured out that starting the compile server was getting an error loading hostfxr when it attempted to start.

Apparently there was some issue related to this recently, but I couldn't figure out how to apply the fix mentioned in this message.

What fixed it for me was when I uninstalled all C# / DotNet related VSCode extensions. Closed VSCode, reopened the project and then allowed it to automatically install recommended extensions and download the needed libraries and tools.

Peter Lamberg
  • 8,151
  • 3
  • 55
  • 69
  • There is also this related question https://stackoverflow.com/questions/47995468/vscode-c-sharp-go-to-definition-f12-not-working – Peter Lamberg Aug 20 '23 at 15:42
  • also related to a lot of unexpected behaviour people have been observing recently: [What changed about the C# extension for VS Code's IntelliSense in the v2.0.320 release?](/q/76850403/11107541) – starball Aug 20 '23 at 22:06