Search Unity

Intellisense not working for Visual Studio Code

Discussion in 'Code Editors & IDEs' started by stpaulgym, Jan 19, 2020.

Thread Status:
Not open for further replies.
  1. weto4ka

    weto4ka

    Joined:
    Feb 8, 2019
    Posts:
    48
    In VS 2019 in the upper is button Attach to Unity just press it and syntax will highlight;)
     
  2. Noikool

    Noikool

    Joined:
    Jan 3, 2021
    Posts:
    1
    Thx man i try this and it's work!!
     
  3. cloud_canvas

    cloud_canvas

    Joined:
    Mar 31, 2015
    Posts:
    14
    This was the fix I was looking for as far as working on macOS in Unity 2019+ goes. Much love for the help.
     
  4. its_zync

    its_zync

    Joined:
    Feb 3, 2021
    Posts:
    2
    pls i really need help,
    i think its because of .NET i cant get intellesense and its hard to type code without this autocomplete system plssss i really need help its been an hour
     
  5. its_zync

    its_zync

    Joined:
    Feb 3, 2021
    Posts:
    2
    guys pls help how do i remove .NET i want intellesense
     
  6. SixDimensional

    SixDimensional

    Joined:
    Nov 6, 2015
    Posts:
    4
    THANK YOU SO MUCH! this worked for me after hours of searching. Restarted everything and Opened C# Solution.
     
  7. gamesaddictforreal

    gamesaddictforreal

    Joined:
    Mar 17, 2021
    Posts:
    1
    I had the same but for me I changed it to v4.6 . Thanks a lot you saved my day
     
  8. zed_shyb

    zed_shyb

    Joined:
    Mar 22, 2021
    Posts:
    1
    Can't get this to work on my mac - what .net version do you use? What "TargetFrameworkVersion" are you pointing out in the csproj file?
     
  9. infensus

    infensus

    Joined:
    Feb 22, 2015
    Posts:
    1
    Damn this is the real OG. This combined with correcting the version in .csproj finally works on Mac VSCode (to 4.8 at the time of writing) and don't have to use Visual Studio. Thanks dude
     
  10. Codeman1010

    Codeman1010

    Joined:
    Jan 26, 2014
    Posts:
    6
    Thank you so very much, this resolved my issue. I was really struggling to fix this. You are the best!
     
  11. tokiyashi

    tokiyashi

    Joined:
    Jun 18, 2021
    Posts:
    2
    Magically resolved the issues, thanks a ton!
     
  12. kangb0

    kangb0

    Joined:
    Jun 28, 2021
    Posts:
    1
    If there's a .gitignore in you repository, commnet out .sln (#.sln) in .gitignore so VSCode can recognize sln file, then you'll get IntelliSense working.
     
  13. nickshelton1376

    nickshelton1376

    Joined:
    Jul 29, 2021
    Posts:
    1
    This worked for me...I was getting C# errors in the VSCode console, basically saying something about OmniSharp wasn't located for VS code 4.7.1... I already had 4.7.1 installed, but not the dev tools from the link.

    Note, I had to install developer tools also, which may be obvious, but you need .NET 4.7.1 and the dev tools installed from the link. Restarted VS code after both were installed, and it works.
     
  14. mark-wiemer

    mark-wiemer

    Joined:
    Apr 26, 2016
    Posts:
    1
    Still works in 2020.3.20f1 and VS Code 1.61. Thanks so much for the clear instructions!
     
  15. LoneXUnity

    LoneXUnity

    Joined:
    Mar 24, 2020
    Posts:
    7
    worked for me good call
     
  16. LoneXUnity

    LoneXUnity

    Joined:
    Mar 24, 2020
    Posts:
    7
    go to your project folder and look for the .proj files open them using vscode and find what .netframework version your project is using.
    example:
    <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
    then go download that version. and install it
    then reload your vscode window it should work.
     
  17. Athomield3D

    Athomield3D

    Joined:
    Aug 29, 2012
    Posts:
    193
    This works thanks ! Also don't forget to install .NET Developper Pack 4.7.1
     
  18. deltameta

    deltameta

    Joined:
    Nov 30, 2020
    Posts:
    5
    I bit the bullet and downloaded the full Visual Studio for Mac. I gave up on Visual Studio Code after a few hours of going in frustrating circles and trying several suggestions on the Unity forum and StackOverflow that didn't work.

    One thing I noticed right off the bat is that the Visual Studio installation will automatically prompt you to download the necessary .NET stuff. I didn't have to run any commands to install things once Visual Studio was installed (although, I did download the dotnet and Mono installations previously for VS Code, so who knows if these were used or not...).



    Once Visual Studio for Mac is installed, I went into Unity and gave Visual Studio Code the ol' boot by updating my preferences to open Visual Studio as my external editor:
    Unity version: 2020.3
    Unity > Preferences > External Tools > External Script Editor > Visual Studio for Mac [8.10.11]
    I've also got Package Manager > Visual Studio Editor installed (2.0.11)

    Finally, I opened my .cs file from within Unity (alternatively, you can right-click and select Open C# Project). Once Visual Studio opened:
    Visual Studio > Preferences > Theme > Dark (we aren't barbarians...)
    ...and then File > Open > and opened my Unity game .sln file.
    I went to the script in question to try things out and badda-bing-badda-boom, intellisense and all my stuff worked and opened without a hitch.

    Best of luck.
     
  19. madigital

    madigital

    Joined:
    Apr 26, 2020
    Posts:
    1
    Thank you so much. The only thing I have found to work!
     
  20. rafaelladeia2000

    rafaelladeia2000

    Joined:
    Oct 22, 2021
    Posts:
    1
    WORKED! Thank you, bro!
     
  21. zoeymnorman

    zoeymnorman

    Joined:
    Nov 9, 2021
    Posts:
    1
    It worked! Thank you so much!
     
    SenseEater likes this.
  22. Atap21

    Atap21

    Joined:
    Mar 28, 2015
    Posts:
    3
    You are the puto amo, mate
     
  23. for3st

    for3st

    Joined:
    Mar 21, 2020
    Posts:
    2
    Guys! Before proceeding to more complex fixes like trying to pick proper versions, regeneration of project files etc., make sure that BASIC things are set up properly:

    In VS code settings json:
    omnisharp.monoPath - make sure this points to really existing folder with mono develop /bin folder inside
    omnisharp.useGlobalMono - just set to "always"

    So in my local set up it looks like:
    Code (JavaScript):
    1.  
    2. "omnisharp.monoPath": "/Library/Frameworks/Mono.framework/Versions/Current",
    3. "omnisharp.useGlobalMono": "always",
    4.  
    That's THE ONLY fix that works for me throughout the years.
     
  24. KIMYEONGGYU

    KIMYEONGGYU

    Joined:
    Nov 11, 2021
    Posts:
    1
    I have no "Developer: Reload Window"
     
  25. Eclipse66

    Eclipse66

    Joined:
    Apr 26, 2021
    Posts:
    1
    I've gone through a lot of other "fixes" and I confirm this one is working ! a couple of clarifications:
    - This needs to be updated in the C# extension settings, not the VS Code settings
    - To know your monoPath, go to a terminal window in VS Code and type "which mono" (just don't consider the "/Commands/mono"). In my case as well, it was "/Library/Frameworks/Mono.framework/Versions/Current"
     
  26. dvalles

    dvalles

    Joined:
    Nov 15, 2014
    Posts:
    11
    For me I had accidentally deleted the .Net tools version the omnisharp server was looking for (4.7.1), it says which one you're missing somewhere in the output after restarting the omnisharp server. I downloaded those and was good to go again.
     
  27. unity_46F55838E00BA0D4F8F3

    unity_46F55838E00BA0D4F8F3

    Joined:
    Jan 22, 2022
    Posts:
    1
    Thanks man! Thats work fine for me!!!!!
     
  28. agustinalejandrolopez

    agustinalejandrolopez

    Joined:
    Mar 15, 2021
    Posts:
    1

    Worked perfectly! thanks a lot
     
  29. Merdynn

    Merdynn

    Joined:
    Nov 7, 2021
    Posts:
    1
    THIS IS THE SOLUTION!
     
  30. WillAtterson

    WillAtterson

    Joined:
    Feb 4, 2022
    Posts:
    1
    Thanks! This solution worked for me. Another solution may be better as it may allow me to use the latest .Net SDK instead of 4.7.1, but at least for now I have Intellisense.
     
  31. malitabbara

    malitabbara

    Joined:
    Feb 14, 2022
    Posts:
    1
    i already have that installed and am facing the same problem :///
     
  32. FernwehSmith

    FernwehSmith

    Joined:
    Jan 31, 2022
    Posts:
    36
    This is the only solution I've found so far that works!!
     
  33. josehsdsilva

    josehsdsilva

    Joined:
    Jan 29, 2021
    Posts:
    1
    If anyone is still having problems with intellisense in Visual Studio Code checkout this video:
     
  34. Saveforth

    Saveforth

    Joined:
    Jan 28, 2022
    Posts:
    3
    Thank you, this worked for me.
     
  35. Gusts92

    Gusts92

    Joined:
    Oct 13, 2015
    Posts:
    18
    I know it's a little bit off this topic, but since it's close enough, does anyone know the official state of the unity debugger extension in vscode? There are already 3 ignored open issues in the repo for almost 1 year, and - although it works ok for me - I worry it might stop working soon and I'll be orphaned of code editors (no, I won't use VS nor Rider).
     
  36. Adityaa589

    Adityaa589

    Joined:
    Jun 3, 2021
    Posts:
    1
    Guys install the developer pack v4.7.1.Installing it will automatically solve the issue,it worked for me.Hope this helps OR Check out the output in VS Code where it shows 'Developer pack[name] not found' and install the developer pack.Hope this helps
     
  37. Ashnaflavdjov

    Ashnaflavdjov

    Joined:
    Mar 1, 2022
    Posts:
    2
    Same for me, i gave up and installed the .NET framework 4.7.1 developer pack from here
     
  38. mustGameDev

    mustGameDev

    Joined:
    Apr 4, 2015
    Posts:
    1
    If you all have NO INTELLISENCE working and all other extentions working. Just Downgrade C# into 1.24 or DOWN. I destroyed 2 mouses and one laptop to find a solution
     
  39. mustafa_kazeminiya

    mustafa_kazeminiya

    Joined:
    May 26, 2022
    Posts:
    1
    install last version of dotnet developer.
    restart computer.
    fixed for me.
     
  40. rameezfyyz

    rameezfyyz

    Joined:
    May 10, 2020
    Posts:
    5
    For me updating my .NET SDK package from 5 to 6 did the trick. Everything is working fine now.
    Steps I had done before this were:
    1. Installed latest .NET Framework SDK and Targetting pack (did not work)
    2. Reinstalled unity visual studio code editor package (did not work)
    3. Deleted unity library and .csproj files (did not work)
    4. Tried setting to use visual studio and then back to vs code (did not work)
    5. Tried deleting and cloning my git repo (did not work)
     
  41. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
  42. VarelaByakko

    VarelaByakko

    Joined:
    Apr 2, 2014
    Posts:
    7
    This morning, I got an issue with IntelliSense because C# for Visual Studio Code was update to 1.25.0 yesterday and only show a few but not variables, methods and others inherited from component.
    Although I have .Net framework 4.7.1 targeting pack

    I fix by downgrade C# for Visual Studio Code back to 1.24.4

    I'm not sure how to fix with 1.25.0 or maybe wait for 1.25.1 to be available in extension to fix it
     
    Last edited: May 26, 2022
    peanutt, enhawk and JulienFullHD like this.
  43. Vagner_

    Vagner_

    Joined:
    Apr 8, 2015
    Posts:
    7
  44. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    1.25.0 :(

    Downgraded C# to v1.24.4 and everything is fine. Always the cat and mouse chase with VSCode and Unity...
     
  45. Owlbear_Headspin

    Owlbear_Headspin

    Joined:
    Jun 25, 2016
    Posts:
    6
  46. paulstraw

    paulstraw

    Joined:
    Apr 17, 2017
    Posts:
    4
    This seems to have been the issue for me as well. I looked at the changelog for the extension (1.25.0 changelog isn't visible on the web currently, only within VSC), and it mentioned disabling the "Use Modern Net" setting for Unity. I disabled that and reloaded, and I'm back up and running!
     
  47. AiKodex

    AiKodex

    Joined:
    Jan 21, 2021
    Posts:
    342
    Thank you for mentioning this fix. Please could you guide me as to where I can disable the "Use Modern Net" setting from.

    Edit: Found it at : Visual Studio Code IDE > C# extension settings. Thank you. It is working now.
     
    Last edited: May 28, 2022
    festaumberto182 likes this.
  48. Hex0dus

    Hex0dus

    Joined:
    May 2, 2018
    Posts:
    5
    This was a bit of surprise to me. After checking the optput log for c# it told me something like this:
    Code (CSharp):
    1. vscode c# Error: Found dotnet version 3.1.100. Minimum required version 6.x
    After a brief research I stumbled upon the fact that they disabled Unity support for C# by default. So either you have to install the dotnet version mentioned in the log or just uncheck this checkbox which I did. After restarting VSCode the intellisence worked again ;-)

    upload_2022-6-6_23-37-12.png
     
    jjv360 likes this.
  49. Geradewegsgegendiewand

    Geradewegsgegendiewand

    Joined:
    Jul 6, 2020
    Posts:
    6
    That is just evil. Half of the day wasted to find the problem and fix it BECAUSE OUT OF F***ING NOWHERE, AFTER A NIGHT OF SLEEP AND NO ACTIVE MISHANDLING, INTELLISENSE WONT WORK ANYMORE
    Superb trollbehaviour..big thanks for that.

    grml

    thx anyway for pointing out this secret
     
  50. rafaelsantosferraz

    rafaelsantosferraz

    Joined:
    Jun 14, 2022
    Posts:
    1
    AiKodex likes this.
Thread Status:
Not open for further replies.