Visual Studio intellisense stopped working

Hello all,

I am running Unity version 5.5.0f3 and had installed the Visual Studio during the installation process. I started a project some time ago using a previous version of Unity (5.4.0f3) and the C# instellisense autocomplete was working fine after conversion. However today, for some reason, the intellisense is not working. I have tried manually loading visual studios and then manually loading the .sln file but that didn’t work. This problem also persists when I use MonoDevelop.

I am wondering could the conversion have done something to mess up the intellisense? Is there a fix for this?

Thanks,

-Tareq

You may have to install .NET again: In Windows, Go to Control Panel / Programs and Features / (then on the left side) Turn window features on and off / and selecting both .NET 3.5 as well as .NET 4.6. You may then also have to reboot your computer after installing. This has worked for some users, let me know if it solves the problem!

I went there and noticed that both the .NET versions were unchecked. Should I check both of them and restart or leave them unchecked and install a new copy?

Yes, check them both and see if that helps.

So I checked them both and it was trying to update them. However it couldn’t, and I get an error code: 0x800F081F
I went on to Microsoft’s website, downloaded their troubleshooting software that they recommended, but that couldn’t identify the problem

I am having a similar problem. I think i must be hitting some sort of hotkey to toggle the intellisense/autocomplete. Occasionally I’ll be be typing a bit haphazardly and shortly after realise that the unity specific autocompletions have disappeared from the tooltip.
Does anybody know if there is a hotkey?

This happend to me today. I was creating a c# script and everything worked fine, later I created another script and somehow all of the Unity/Mono classes and the Unity message methods were not syntax highlighted. This happend to me before, when I opened a script after creating it, before Unity compiled. Then I had to rename the script to get a prompt in Visual Studio “Reload Solution” or so and after reloading, intellisense worked again. Now this time I waited for Unity to compile but syntax highlighting seems to be broken. Not even renaming script files solves the problem anymore. It is weird because since then, no matter how often I reload Unity or Visual Studio (I have the newest version for both), intellisense doesn’t work anymore for the scripts I create. Yet for the script I created where intellisense was still working, well intellisense still works. But only for that file. Lol? Also in the solution explorer in visual studio, all of the c# files where intellisense doesn’t work, they don’t have a class in the hierarchy: Normally every c# file has the classes listed inside it when you expand it, but for the scripts where intellisense stopped working, there is nothing to expand, so not only intellisense is broken, but also visual studio itself seems to be broken. It is weird that this is not solved yet since the fact that visual studios intellisense sometimes is broken when you open scripts before Unity compiles, this has been as far as i can remember, but now that everything is totally broken and I cannot program anymore with visual studio, this is insane, really. And I am not going to reinstall those tons of gigs for Unity and visual studio (and maybe .net or maybe even Windows? :wink: ) just because visual studio or Unity or whatever randomly decided to stop working and apparently I am not the only one on this and this thread isn’t the only one on this topic. :hushed:



3260813--251411--works.png

1 Like

You can force the solution to regenerate by deleting the .sln file in your assets folder and then open the solution from Unity again. Delete all of the .csproj files while you’re at it.

10 Likes

Yep, bumping this here because I’m having this exactly same problem. Everything was fine on Windows 8.1, I had to format my PC (updated to Win 10) and installed a fresh Unity 2017.2.0f3 version and the VS Community 2017 that comes with it. Going back to MonoDevelop and there goes my productivity because I was too used to VS.

OMG @Baste – you’re a lifesaver. I had this same problem (and had it on another dev machine that I had to switch back to MonoDevelop on) and your method works!!!

1 Like

@Baste answer will fix all. Thanks.

@Baste 's solution didn’t work for me, after I create a new file, intellisense doesn’t work on it also it doesn’t appear on the files list in the solution explorer, I need to hit the refresh button on the solution panel…

I’m having the same symptoms, probably the same core issue. If you look at the file in VS when it’s open, you will see it hasn’t been assigned to the correct project, it gets stuck in Misc files project which is probably some internal project that files go in when someone adds it to a solution incorrectly.

But in any case, in VS explorer right click and exclude it from the project. Then do Project → Show all files (it’s a toggle). Now include it and it should be in the correct project and the problem is fixed. And finally Project → Show all files to toggle it back to not showing excluded files.

2 Likes

This started happening to me after updating to VS2017 15.4.0
There’s a similar report on the Microsoft Dev Community forums

1 Like

Thanks @snacktime that worked for me as well! Appreciate the tip!

This problem is still occurring in VS 2017 CE 15.4.4. @snacktime I couldn’t seem to figure out your solution, however I was able to find a quicker workaround based off yours. @ScottAdams and anyone else having this issue, a quicker workaround to the issue is with the file open go to: File → Move [filename] into > Assembly-CSharp and that should get you going again.

This happens to me from time to time and both @snacktime 's and @Baste 's solutions work for me. Thanks guys this was driving me insane! :smile:

I’m on Unity 2017.2 and VS 15.4.2

Ah, okay, what is fixing this for me, at least when this happens when I create a script file, is hitting the refresh button in the Solution Explorer pane.

Both highlighting and intellisense stops working on new files, hitting refresh is solving this for me.

I tried hitting the refresh button in the solution view but it didn’t work for me. Maybe there are two different core issues here? Do you also get the file marked as “miscellaneous file”?

Supposedly it is fixed in 15.5 which will ship soon.

In the meantime, keep nuking the csproj/sln files.

1 Like