Intellisense not working for Visual Studio Code

Operating System: Windows 10

Problem:

  1. Intellisense and Autocomplete not working for VScode.
  2. Opening c# script within the editor opens VSCode. However, VScode Doesn’t automatically open a project folder.

Programs and program versions: Unity 2019.18f1, VSCode 14.1

VSCode Extensions:
1.[ c#](http:// C# - Visual Studio Marketplace)
2. Visual Studio Intellisense
3. Unity Debugger
4. Unity Tools

Attempted solutions:

  1. Tested with .Net 4.6.x, .Net 4.7.x, .Net 4.8.x and same results
  2. Fully uninstalled and reinstalled VSCode as well as Unity. Same results.
  3. Followed this guide but no change.
  4. Instead of selecting the Visual Studio Code in External tools I attempted to open the code.exe file directly, no changes.
    Any Help to fix these problems would be great.
    Thanks.
13 Likes

Same here!

1 Like

I believe it’s due to updating the debugger, and pointing to a new C#/Omnisharp VS code extension. I have a workaround here:

3 Likes

Any solutions?

Same. Hate it.

You need visual studio code from package manager. I wish this is included with Unity.

4 Likes

Bro, i have the answer for you. the solution is super SIMPLE
you just have to download this tool

  • Unity Code Snippets by Kleber Silva
    which you can find it on VSCode, after installing it, close the VSCode and reopen.
    That’s it.

I’ve been strolling to any possible solutions I could find for the same problems as yours, but the answer is just as away as your right-hand to your mouse.

31 Likes

I found a fix for this in VSCode and it’s only a few steps.

Your environment in VSCode may vary, but I have all the extensions you have in the OP.

But here’s what I experience. I make a new project, after OmniSharp loads in VSCode. The packages don’t highlight correctly, and I don’t have intellisense. So I do the following:

  • Go to Unity → Edit → Preferences → External Tools
  • Look for the section near the top called “Generate .csproj files for:” and click “Regenerate Project Files” with everything unchecked.
  • Then in VSCode I press “Ctrl + Shift + P” and run the action for “Developer: Reload Window”

Intellisense and all your other syntax highlighting should start working again.

I hope this works for y’all. I am on Unity 2019.3.13f1
EDIT: Removed the step to delete the Assembly-CSharp.csproj file. Regenerating it in step 2 is enough.

241 Likes

I was also stumbled upon the same problem recently.

The problem with me was that in *.csproj file it was referencing to the .net framework v4.7.1 so I simply edit the *.csproj file to v4.8 and all the intellisense were back.

13 Likes

Sometimes I have this issue, also. Consider upgrading Visual Studio Code package to 1.2.0 and if omnisharp doesn't work, right click to anyplace in assets and click Open C# Project.

3 Likes

Install .NET core sdk and restart your PC. It worked for me.
download here:

5 Likes

Thank you sooo much, i’ve try different solution but that’s the only one that worked for me! :wink:

4 Likes

Thank you very much this worked for me. Before I did this classes like “Rigidbody”, “Animation”, etc. were not showing so thank you very much!

1 Like

Hey guys, my VSCode refuses to run Intellisense, I've tried absolutely everything and I am stuck. Kindly let me know what files and logs you need to see to help. I've restarted my computer, implemented all the fixes on this thread, but nothing has worked.

EDIT: I have a Windows 10 64-bit PC, running Unity 2019.3.14f1, .NET Framework 4.8.0, .NET Core SDK version 3.1.300, Visual Studio Code version 1.45.1, C# extension version 1.22.0

2 Likes

I think I can help. On Windows 10 64-bit, Unity 2019.3.15f1 requires the 4.7.1 .NET Framework. You can see this in the error log:

The reference assemblies for framework ".NETFramework,Version=v4.7.1" were not found

Since VS Code is a text editor, it needs to have the framework locally install; having Unity open it isn’t good enough. So, I needed to download the .Net Framework, version 4.7.1!

So basically, I downloaded this and now I have Intellisense:

P.S. You might have to restart Unity, VS Code, and your laptop.

11 Likes

That’s worked for me, thanks bro :slight_smile:

1 Like

Going to go try this now. Thanks for the quick response! I’ll let you know how it goes.

Cheers!

@dan_unity868 it worked! I combined it with a fix which said it might be a dual drive problem (my .NET stuff was on C:\ but VSCode was on D:) Thanks a ton for your time! Good luck!

Worked for me, thanks!

isso funcionou para min!