Visual studio 2019 не работает intellisense

Fixing Intellisense and Go To Definition in Visual Studio 2019

I had a set of very strange problems after upgrading to Visual Studio 2019 early this week, and they were significantly hampering my ability to get work done.

  1. Go To Definition didn’t work for a great many classes, methods, and properties.
  2. Intellisense was straight-up missing in multiple places.

I hadn’t realized how much I relied on those two features of Visual Studio until I could no longer use them. It was like suddenly missing a finger, or being unable to find my phone: part of myself was gone.

«I can hear it buzzing. Where the $#^! is it?!» Photo by André François McKenzie / Unsplash

I went off to Google the problem and found nothing that helped me. So, when I eventually did find the solution that worked for me, it occurred to me that I cannot be the only one with this problem. Hence, this post.

Here’s how I fixed my missing Intellisense and nonfunctional Go To Definition in Visual Studio 2019.

(If you’re just looking for the solution, jump to the Summary section at the bottom)

Tracking the Problem

Our project is an ASP.NET Framework 4.5.2 MVC solution, with lots of other tech thrown in (e.g. Entity Framework). As I mentioned at the time, the Intellisense and definitions were not missing for all of my classes, methods, etc., just for a majority of them. For example, in my controllers I could not use Go To Definition on the ASP.NET MVC Controller class, nor the attribute HttpGet, nor any of our custom classes for this project. But I could use it on certain common extensions, such as ToString or ToList.

It took me a while to work this out, but I eventually determined that what I was actually missing was all of ASP.NET MVC and Entity Framework. With that commonality in mind, I started poking around the solution, which is when I discovered this:

All of my project references were in error! Even ones that should exist on my system, like System.Data.

Which is stupid. I can use this project perfectly fine in VS 2017, so why was VS 2019 giving me such problems? And, more importantly, what was I going to do about it?

Potential Solution #1: Delete the .vs File

A bit of googling lead me to this blog post by Rick Strahl which suggested that I should delete the hidden .vs folder at the root of my solution. When I did so and opened Visual Studio again, VS recreated this folder. But, unfortunately, it didn’t fix the issues I was having with Intellisense and Go To Definition.

It was at this point that something occurred to me: all of the things which I could not get Intellisense for (MVC and EF) were, in fact, NuGet packages. I wondered if this had something to do with NuGet, and, it turns out, it does!

Potential Solution #2: Restore NuGet Packages

There’s a right-click option on .sln files called «Restore NuGet Packages». This was the first thing I attempted to do while trying to fix this problem. Unfortunately, it didn’t help, because all I got was this:

«All packages are already installed and there is nothing to restore.» Which is not helpful in the least.

Potential Solution #3: Use the NuGet UI

The next thing I could think to do was use the NuGet UI within Visual Studio to reinstall all the packages. Problem is, there is approximately (counts on fingers) 57 jillion packages on this solution. Refreshing them using the UI would take a lot of time.

Читайте также:  Мерседес 190 не работает спидометр

Clearly I was not going to do this. I needed something a bit more. forceful. Which is when I stumbled upon the actual, final solution that restored Intellisense and fixed Go To Definition.

Actual Solution: Delete Local NuGet Packages

. I deleted my local copy of this solution’s NuGet packages.

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.

Another stupid problem solved!

If I’m being completely honest, I do not know exactly why this works. After all, Visual Studio showed errors on references which should exist on my local machine, not in NuGet packages. But at this point, I don’t particularly care why it works, I’m just glad it does.

Summary

It turned out the issue was related to NuGet; what I needed to do was delete the contents of the packages folder. For completeness’s sake, here’s the steps to do what I did.

  1. Close all instances of Visual Studio 2019.
  2. Delete the contents of the packages folder at the root of your solution on your local machine.
  3. Open Visual Studio 2019 again.

This final solution worked for me. I am including the potential solutions in this post in the hopes that one of them (actual or potential) works for you, dear reader. Let me know if you have any other solutions in the comments!

Источник

Почему intellisense и подсказки кода перестают работать, когда Visual Studio открыт?

У меня были проблемы с Intellisense в Microsoft Visual Studio 2012 . Я буду работать над проектом, редактировать код и все такое (через некоторое время, от 5 минут до более часа) и внезапно, больше никаких предложений по коду или интеллигенции. Кажется, что оба перестают работать полностью одновременно.

Единственное решение, которое я попробовал, — сбросить все мои настройки, полностью закрыть Visual Studio и снова открыть проект. Есть ли лучшее решение или обновление, которое исправит это?

Я провел много времени, исследуя ту же проблему. Некоторые решения связывают эту ошибку с некоторыми ссылочными сборками. Другие говорили, что так Microsoft.Windows.Design.Extension.dll и .Interactivity.dll должно быть в ссылках проекта. Но ни одно из этих решений не помогло мне.

Я думаю, что это ошибка в Visual Studio 2012, Microsoft должна исправить это.

Я должен отметить, что у меня не было проблемы с момента обновления моей оперативной памяти. Я не могу подтвердить, связано ли это, но проблема была распространена, когда у меня было 2-4 ГБ ОЗУ. Никаких проблем, так как собирается 8 и 16Гб.

Если кажется, что затронут только один файл / окно, закройте и снова откройте этот файл. Если это не сработает, попробуйте ниже.

В Visual Studio:

  1. Нажмите Инструменты-> Параметры-> Текстовый редактор-> Все языки-> Общие
  2. Снимите флажок «Авто список участников»
  3. Снимите флажок «Информация о параметре»
  4. Отметьте «Авто список участников» (да, тот, который вы только что отметили)
  5. Проверьте «Информация о параметре» (опять же, тот, который вы только что отметили)
  6. Нажмите ОК

Если это не сработает, попробуйте еще несколько шагов:

  1. Закройте все документы VS и снова откройте
  2. Если все еще не работает, закройте / снова откройте решение
  3. Если все еще не работает, перезапустите VS.

Для проектов C ++: у
MSDN есть несколько вещей, которые стоит попробовать: предложения MSDN

Поврежденный .ncb файл кажется наиболее вероятным.

  1. Закройте решение.
  2. Удалить .ncb файл.
  3. Вновь откройте решение. (Это создает новый .ncb файл.)
  • Протестировано в VS 2013/2015

Регистрация возможных причин:

  • Копирование / вставка элементов управления на исходной странице. Я обнаружил, что мой designer.vb файл тоже не обновлялся.
  • Скопируйте / вставьте код с другой страницы, которая вызвала ошибку, потому что скопированный код ссылался на элемент управления, которого не было на странице, на которую я вставлял.
  • Проект C ++ имеет поврежденный .ncb файл
Читайте также:  Мечта не работать не работает

(Пожалуйста, добавьте в комментарии, если вы заметили поведение, которое вызывает это.)

Источник

Visual studio 2019 не работает intellisense

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Asked by:

Question

I’m having issues with one specific project in VS2019. After upgrading from VS2017, I got the solution from the TFS.

Everything was working fine until I modified a file of this project. Intellisense stopped working.

It should be something related to this project file because if I modify other files in other projects from the same solution it keeps working fine.

What can I do to try to fix it?

All replies

Welcome to the MSDN forum,

“ Everything was working fine until I modified a file of this project. Intellisense stopped working. ” What and how did file you modify? Could share us the specific steps and info? Did you try to rebuild your project after modifying done?

I am guessing, Intellisense doesn’t know what to do or recognize this file, please unload and reload it.

If not, please have a try with the following steps to clean caches of your project:

  1. View => Solution Explorer (in case it isn’t already open)
  2. Right click » Solution ‘Project name‘ «
  3. Click » Open Folder in File Explorer «
  4. Close Visual Studio
  5. Show hidden folders ( Win10 How-to )
  6. Delete folder » .vs «
  7. Open Visual Studio and project (wait a few seconds)

Источник

Visual studio 2019 go to definition and Intellisense not working

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.

13 Answers 13

  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

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

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 .

This will restart Visual Studio with your project.

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

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

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.

Читайте также:  Что с телеграммам почему не работает

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.

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

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.

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

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.

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

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?

Источник

Оцените статью