Intellisense not working in Visual Studio 2017

I have found that there are several problems with losing intellisense in my scripts while using Visual Studio 2017 (not sure if this persists in MonoDevelop). It still will compile the code it will just, for example, lose all color behind UnityEngine references and any other project file references, and lose the ability to autocomplete. Such as interfaces and other things.

One know way to reproduce this bug:

  • Open script Visual Studio
  • In Unity move script to a different folder
  • Return to Visual Studio

Once you move the script, you would want to reopen the file in Visual Studio. Does this work?

I’ve actually encountered the same issue as of late. The only remedy I’ve found is to delete the hidden .vs folder in the root project directory – I’m assuming the .suo file specifically – and then reopen visual studio for it to be rebuilt.

This happens for me on any new script created, or moved to a new folder. Closing and reopening VS doesn’t resolve the issue for me.

I’m using VS 15.4.1, and Unity 2017.1.1f1

1 Like

Heh, and here I was thinking it was just me. Observed the same thing – Unity and VS2017 seemed to behave badly. I thought it was just because I still had VS2015 installed for previous versions of Unity (I keep them installed), so that probably confused things on my system (specifically the Unity for VS tool).

I just stuck with VS2015 for Unity projects, and VS2017 for non-Unity projects.

Of course there’s still the problem of Unity crashing when I tried to hit a breakpoint in a coroutine, but that’s another conversation.

No. This seems to be a common error. New enough for no one to post about it. Seems like its because a more prevalent problem in Unity 2017.

Sweet! I’m glad there is a workaround. Thank you.

Thank you for the workaround - this has been driving me nuts :slight_smile:

2 Likes

I see this problem too - Add a new class in Unity - double click to open in visual studio 2017 - it knows nothing about Unity types for that new class. Also if you click the “Sync with active document” button in the Solution Explorer it does not work for the new file (though in UnityProject Explorer it does).

2017 seems to be a step backwards for Unity compatibility (unless it’s my Unity editor version - 5.5.5)

perhaps better to stick with 2015 for now (does 2017 add any must-have additions?)

Sometimes you can go into the Solution Explorer in VS and click “show all files”, then find the file you are working on, right click it and “add to project”, and that fixes it.

But sometimes (about 25% of the time), this option isn’t available when this problem crops up for me.

Same happens for me. Running 2017.1.2p1
It didnt happen on my previous setup. But after getting a new PC, this happens every time I create a new c# file.

When this happens, and I rebuild the solution, it suddenly also loses references to other classes of certain plugins (like EasySave2)

Here is a MSFT fix: Developer Community

1 Like

This fixed it for me, I already had NPM installed, but I unchecked it and reinstalled it. All good now.

All, this was DRIVING ME MAD for about 4 hours. Tried so many things, un-installing Unity & VS, re-installing. [Unity 2017 2 & 1 and VS 2017]

Ultimately here is the fix for me, hopefully this helps others:

Do the following:

  • Close both VS and Unity

  • Launch VS 2017 Installer

  • Click Modify

  • Go to the “Individual components” tab

  • In the “Code Tools” section, check “Nuget Package Manager”

  • Click Modify

Now, reload your project in VS/Unity.

It should solve your build+intellisense issues.