Visual studio 2019 go to definition and Intellisense not working
Asked Answered
H

14

21

I have noticed a weird issue with Visual Studio 2019 v16.0.1 the IntelliSense about "Using directive is unnecessary" normally grey is missing and type reference suggestion for missing using is not working.

I also tried with Visual Studio 2019 Preview but no luck.

I have tried the following:

  1. deleted .vs folder and restarted.
  2. Reinstalled Visual Studio
  3. Reset settings via import and export setting under tools

Any other suggestions will be appreciated.

Hearth answered 13/8, 2019 at 9:25 Comment(5)
mine works, I am using a preview... latest, which project are you trying to create? as in which template have you create? WPF or Win FOrms, or net core??Eiten
exact same question here: #55660193 tried to update?Supercharger
Try updating to latest version to check if it helps. And if this issue occurs in simple console app or class library. If it only occurs in specific project type, share more details(project type, framework,nuget package...) so that we can check for you:)Miscible
Hi Priyanshu, any update for this issue?Miscible
Turning it off and on again often gets it working again.Quitclaim
M
48
  1. Close Visual Studio
  2. Delete .vs folder (it is a hidden folder inside the folder which contains the solution *.sln)
  3. Start Visual Studio

Solved my problem

Update From the comments

Deleting Browse.VC.db file within .vs folder worked for me.
I did this to avoid deleting .suo which has information I want to preserve

NOTE 1: I am using Visual Studio 2019, but it may work on other versions
NOTE 2: This did not solve the OP problem, but it is a good candidate to solve your

Millipede answered 4/6, 2020 at 11:10 Comment(9)
Where is the .vs folder?Checkpoint
@MorioBoncz 1. are you sure that you are showing the hidden folders because by default it is the hidden folder? 2. Make sure to build the project at least one time using VS 3.You are using VS not VS code :)Arras
Deleting Browse.VC.db within .vs worked for me. I did this to avoid deleting .suo which has information I want to preserve and is in the .vs folder.Dextrin
Downvoting this, removing the .vs folder broke the connection with TFS source control and it was not easy to add the solution back to source control.Acidforming
@Acidforming Thanks for the info, it is important for the people who use TFS, I did not knowArras
This solved my issue. Had restarted my system and VS 2019 Enterprise edition more than 10 times.Sliwa
This is the way.Acidify
Gotta love MS for these little hidden gems.Stoffel
To find the .vs folder on MacOS use the hotkey CMD+SHIFT+ . (period key) which toggles hidden folders on/off.Beria
A
8

Go to Tools -> Options -> Text Editor -> All Languages -> General. Make sure “Auto List Members” is checked. Also, make sure “Parameter Information” is checked.

Angelia answered 6/3, 2020 at 12:40 Comment(2)
Worked perfectly to me. For me those two options were marked as a square not as a V so I just made sure that it is marked as V for all languages.Deiform
Thanks. Resharper must have disabled this for me.Colleen
D
6

If you are facing this issue with Unity projects then,

  1. Check in your Unity settings whether it has Visual Studio configured as the external editor.
  2. Click on Regenarate project files in the Unity settings.
  3. Go to Assets => Open C# project.

unity settings help

This will restart Visual Studio with your project.

Diadromous answered 30/6, 2020 at 18:17 Comment(1)
Fore more details check this linkThedrick
S
3

In my case, Resharper is the culprit. Disabling it immediately solved the issue.

Skirt answered 21/1, 2021 at 19:52 Comment(1)
This, in fact, did help! Now the next step would be to figure out what exactly in ReSharper causes the problem and fix it.Scrumptious
S
1

I think these issues are discussed here and are resolved by an update and some worksrounds are bring discussed:

https://developercommunity.visualstudio.com/content/problem/505489/cannot-navigate-to-the-symbol-under-the-caret-3.html

Supercharger answered 13/8, 2019 at 10:30 Comment(0)
C
1

For anyone who are searching for another suggestion, I just go throught this issue, as OP said, I've deleted .vs folder, I've update vs to last version, I've uninstalled and reinstalled vs to the last version, I've reset settings, delete all obj folders, I've installed Microsoft.Net.Compilers but nothing worked, at the end I just remembered that sometimes the projects required WindowsBase library, until now I don't know why, but after adding that dll Intellisense started to function again.

Claudineclaudio answered 27/3, 2020 at 1:12 Comment(0)
F
1

I tried lots of things but nothing worked for me until I found this post. He mentions a few things I have already tried that didn't work, but his final solution worked for me...

At the root of our solution there is a packages folder. I deleted the entire contents of this folder. Upon reopening Visual Studio, Intellisense and Go To Definition were restored to full working order.

Frasquito answered 24/8, 2020 at 23:45 Comment(0)
C
1

I use resharper (vs 2017) but had not installed it on 2019. After installing Resharper on 2019 the intellisense started working again. (yes, it was working in 2019, then stopped) I don't have an explanation on why this would fix it. Just did for me.

Chloris answered 10/9, 2021 at 18:27 Comment(0)
S
0

First time I use VS 2019, I need to manually install Code Analysis. Make sure it is installed at your project properties.

VS2019

And today, for the new class, the suggestion or namespaces not showing for VS 2019 Intellisense, and Go to Definition not working too.

I must do close solution, and re-open and VS 2019 doing scanning while opening project, and then worked again.

I think this is bug for VS 2019. Try to close solution and re-open it.

Stilbite answered 7/8, 2020 at 8:53 Comment(0)
M
0

I have tried almost all the solution mentioned above but it doesn't helped me. Trying to restart my PC solved my problem.

Miculek answered 18/8, 2020 at 14:37 Comment(0)
E
0

close visual stdio For mac in your folder: do command + shift+ . you will see hidden files -> delete .vs folder open solution again

Extreme answered 29/8, 2020 at 5:18 Comment(0)
H
0

After working for a few months, Intellisense suddenly stopped. This cost me a lot of lost time! I've been worked with Visual Studio for about 10 years, and this problem happens occasionally in every version.

Here's what I tried for this iteration of the problem:

  • Closing Visual Studio and re-opening does sometimes make the problem disappear for a short time, but it certainly doesn't solve it
  • Likewise restarting my laptop
  • Installing the latest Visual Studio 2019 update didn't help (I'm on 16.8.3 now if anyone's interested)
  • Deleting the hidden .vs folder doesn't seem to solve anything (doing so also means you lose your current window layout, as well as any bookmarks you've set)
  • Unticking the Track Changes option in this menu: Tools-> Options-> Text Editor-> General.
  • I've updated my NuGet reference to the Microsoft.Net.Compilers library to the latest stable version, as suggested here, but sadly this made no difference

I thought I've finally solved the problem by following the advice from Homer. I deleted the packages folder at the base level of my project (somewhat nervously, as I wasn't sure if it was needed), and thought it had solved the problem, but no such luck.

However, one thing to watch out for - after doing this, Visual Studio recognised my classes but no longer recognised built-in ones (all the referenced namespaces at the top of my controllers were underlined in red). I then deleted the .vs folder (again), which seemed to solve the problem.

When I recompiled my solution, it gave a few CS0433 compilation errors with duplicate namespaces for the MinLength and MaxLength directives in some identity user name and password validation code. I got round this by removing the Microsoft.EntityFramework Nuget library (I had to also remove Microsoft.AspNet.Identity.EntityFramework too, since this depended on it), then adding them both back in, making sure to include at least version 6.2 of the former (otherwise I got another runtime error to do with the FirstOrDefaultAsync method called somewhere!).

My current situation: all existing Intellisense is working, but it's not recognising new classes I add unless I exit Visual Studio and go back in again. May have to live with this ... unless anyone can help me?

Handfast answered 15/12, 2020 at 9:50 Comment(0)
I
0

I've got that problem today with only one project. I got no Intellisense warnings (i.e. naming styles, "Variable not referenced", etc..) for files in that project. Not in VS 2017 Pro nor in VS 2019 Community.

Check, if your Project->Build->"Warning level" is set to 0...

Incunabula answered 18/8, 2021 at 11:26 Comment(0)
K
0

If you have Visual Studio 2017 installed side-by-side with Visual Studio 2019, close VS2019, open the project in VS2017, wait until it is fully loaded, then close VS2017, and reopen VS2019 - fixed!

There must be a bug in the VS2019 intellisense stuff, but VS2017 seems to fix it with no need to keep deleting the .vs directory.

Kennith answered 7/12, 2021 at 3:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.