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.
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.
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.
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)