Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Intellisense not working for Visual Studio Code

Discussion in 'External Tools' started by stpaulgym, Jan 19, 2020.

  1. stpaulgym

    stpaulgym

    Joined:
    Sep 2, 2018
    Posts:
    4
    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#
    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.
     
  2. WookieWookie

    WookieWookie

    Joined:
    Mar 10, 2014
    Posts:
    16
    Same here!
     
  3. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    50
  4. NAV_training

    NAV_training

    Joined:
    Nov 3, 2019
    Posts:
    4
    Any solutions?
     
  5. Astromanson

    Astromanson

    Joined:
    Apr 8, 2017
    Posts:
    32
    Same. Hate it.
     
  6. valarus

    valarus

    Joined:
    Apr 7, 2019
    Posts:
    174
    You need visual studio code from package manager. I wish this is included with Unity.
     
    Beerfootbandit likes this.
  7. paulusuluap

    paulusuluap

    Joined:
    May 12, 2020
    Posts:
    1
    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.
     
  8. hudspeth

    hudspeth

    Joined:
    Jan 9, 2014
    Posts:
    1
    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:
    1. Go to Unity -> Edit -> Preferences -> External Tools
    2. Look for the section near the top called "Generate .csproj files for:" and click "Regenerate Project Files" with everything unchecked.
    3. 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.
     
    Last edited: Jun 9, 2020
  9. sahilpant16

    sahilpant16

    Joined:
    May 21, 2020
    Posts:
    1
    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.
     
  10. MrPaparoz

    MrPaparoz

    Joined:
    Apr 14, 2018
    Posts:
    75
    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.
     
    Humii and Gertbo like this.
  11. NeoElMoko

    NeoElMoko

    Joined:
    Apr 24, 2017
    Posts:
    1
    YardGnomeNinja likes this.
  12. ElPaso

    ElPaso

    Joined:
    May 23, 2020
    Posts:
    1
    Thank you sooo much, i've try different solution but that's the only one that worked for me! ;)
     
  13. unity_Jnrav_B4WVz0Lw

    unity_Jnrav_B4WVz0Lw

    Joined:
    May 28, 2020
    Posts:
    1
    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!
     
  14. aaronshawcsh

    aaronshawcsh

    Joined:
    May 1, 2020
    Posts:
    3
    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
     
    Last edited: May 31, 2020
  15. dan_unity868

    dan_unity868

    Joined:
    May 30, 2020
    Posts:
    1
    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:
    https://dotnet.microsoft.com/download/dotnet-framework/net471

    P.S. You might have to restart Unity, VS Code, and your laptop.
     
    dead_life and JockyCracker like this.
  16. EyupJohn

    EyupJohn

    Joined:
    May 15, 2020
    Posts:
    1
    That's worked for me, thanks bro :)
     
  17. aaronshawcsh

    aaronshawcsh

    Joined:
    May 1, 2020
    Posts:
    3
  18. aaronshawcsh

    aaronshawcsh

    Joined:
    May 1, 2020
    Posts:
    3
    @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!
     
  19. murkhies

    murkhies

    Joined:
    Jan 31, 2020
    Posts:
    1
    Worked for me, thanks!
     
  20. correiaN

    correiaN

    Joined:
    Mar 13, 2020
    Posts:
    1
    isso funcionou para min!
     
  21. HernandoNJ

    HernandoNJ

    Joined:
    May 13, 2018
    Posts:
    10
    Thank you very much. It worked for me.
    I had
    Code (CSharp):
    1. Assembly-CSharp.csproj ... <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
    But when checking in installed programs, I had 4.6 version in the laptop. So, I closed VS code, removed 4.6 version, installed 4.8 and changed it in *.csproj file
    Code (CSharp):
    1. <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    4.8 version link: https://dotnet.microsoft.com/downlo...nk-you/net48-developer-pack-offline-installer
     
  22. valen308

    valen308

    Joined:
    Nov 16, 2016
    Posts:
    1
    For me, it was that I was missing a certain .NET SDK version. Check the output.
     
  23. Alf4ed

    Alf4ed

    Joined:
    Oct 31, 2018
    Posts:
    1
    Thanks so much. Been trying to work this out for ages. It was a perfect fix.
     
  24. LandonHughesLLC

    LandonHughesLLC

    Joined:
    Feb 18, 2016
    Posts:
    4
    Thank you so much!! Everything works great now!
     
  25. exjuantelleria97

    exjuantelleria97

    Joined:
    Friday
    Posts:
    2
    How do you do this??
     
  26. exjuantelleria97

    exjuantelleria97

    Joined:
    Friday
    Posts:
    2
    I just used Visual Studio 2017 and when opened the script asked me to use .NET framework version 4.6.1 and just accepted. Intellisense worked just fine. I would love to use VS Code since its lighter but whatever
     
  27. StaszekJedi

    StaszekJedi

    Joined:
    Saturday
    Posts:
    1
    Thanks so much, it's working
     
unityunity