Search Unity

Intellisense Not Working with Visual Studio (Fix)

Discussion in 'Code Editors & IDEs' started by DavidG_Fenex, Feb 27, 2020.

  1. unity_TKammeyer

    unity_TKammeyer

    Joined:
    Apr 4, 2021
    Posts:
    1
    Still working - thx.
     
  2. Leonard_InitializeGame

    Leonard_InitializeGame

    Joined:
    Jun 1, 2020
    Posts:
    5
    What a joke
    2019.4.23 LTS version not work with Mac Visual Studio, it should be a stable version
    Double click on console does not take me to the line, what a painful for debugging

    Mac OS Big Sur 11.23
    Unity 2019.4.23 LTS
    Visual Studio for Mac 2019 Community 8.9.5 (Build 5)

    Unity -> Preferences -> External Script Editor -> Select as Visual Studio
    Generate .csproj files for: All checked and clicked Regenerate project files then restart Unity
    Visual Studio make sure it is "Attached to Unity"
    Package Manager -> Visual Studio Code Editor -> Updated to Version 1.2.3 (2019.4 verified)
    Tried downgrade also not work.
     
  3. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    What he said. Debugging and Intellisense were back after doing this.
     
  4. unity_mq4atq9UGAKPBQ

    unity_mq4atq9UGAKPBQ

    Joined:
    Apr 16, 2021
    Posts:
    1
    OH GOD! THANKS! It's working!
    (Unity 2021.1.2f1 & VS2019 16.9.4)
     
  5. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,967
    If you are still having this problem o_O

    See if this helps:

    1) Go to Visual Studio Installer (link below if you need to download it again)
    https://visualstudio.microsoft.com/downloads/

    2) Choose 'Modify' button on your installed version of VS



    3) Enable Game development with Unity

     
  6. Cdaked

    Cdaked

    Joined:
    Apr 8, 2021
    Posts:
    1
  7. marartb1

    marartb1

    Joined:
    Mar 4, 2021
    Posts:
    5
    Here a solution, go to folder game, enter on "yourgame.sln" ,vstudio will open by default.
    Then go to unity and select enter script you do want open , buala!
    inteligence will work, i dont know why , i did open script from unity editor dont work.

    Recapitulate:
    -Open file/ project.sln
    -On unity editor/ open script.
    this should working.


    good programing.
     
  8. krenar_

    krenar_

    Joined:
    Dec 11, 2020
    Posts:
    10
    Hey everyone, I think I found a solution! (Unity 2019.4.23, Visual Studio Community for mac v.8.9.7 build 8)

    - Open solution in VisualStudio (double click any script in unity project)
    - Go to View -> Solution
    - From the solution window, select all .csproj files (at this point they name should have (unavailable) postfix)
    - Right click on them, and choose reload.
    - Restart Visual Studio if needed

    Did it work? Let me know!

    P.S. @John_MSFT just wanted to tag and let you know about this solution, since you're PM on the microsoft team
     
    Last edited: Apr 23, 2021
    John_MSFT likes this.
  9. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,059
    thank you
     
  10. tnqlsehdrn9298

    tnqlsehdrn9298

    Joined:
    May 2, 2021
    Posts:
    1
    You're a hero.
    Thanks to you, I solved it. Thank you.
     
  11. hussaingoodboi

    hussaingoodboi

    Joined:
    May 8, 2021
    Posts:
    1
    Worked like a charm! Thanks so much!
     
  12. unity_xUnNbSQkLUvKvA

    unity_xUnNbSQkLUvKvA

    Joined:
    Feb 20, 2021
    Posts:
    1
    This literally made my day. Thank you so much!
     
  13. IsaacLe

    IsaacLe

    Joined:
    May 13, 2021
    Posts:
    2
    It works, thanks
     
  14. theoscheele5

    theoscheele5

    Joined:
    May 15, 2021
    Posts:
    1
    Dude it seems like im too dumb for this... can you maybe add me in discord and watch me trying to fix it and tell me what to do... altough this seems weird im just F***ed up at this point
    Add me if you want to: SpaceNoob#5961
     
  15. pandolfini

    pandolfini

    Joined:
    Feb 5, 2020
    Posts:
    17
    This is correct.
     
  16. brian1gramm1

    brian1gramm1

    Joined:
    Sep 15, 2017
    Posts:
    56
    Step 3:
    In External Tools go to the part that says External Script Editor (this should be on which ever Visual Studio editor you are using (for me it defaulted to "Open by File Extension"

    This fails to save when I close Unity 2020.2.1f1
    So when I reopen Unity I have to all the steps over again.

    Anyone have a fix for this?
     
  17. ElfGambit

    ElfGambit

    Joined:
    Jul 4, 2020
    Posts:
    2
    I have both VS17 and VS19 on my system as I was upgrading. Working fine with VS17 forever but the new VS19 does not have Intellisense. In Unity 2020.3.9 I changed "External Script Editor Args" from the default "open by file extension", to the specific version of VS19 that I want to run. Open a script in Unity and once VSxx opens, wait 10-15 seconds. The intelisense becomes highlighted as expected.

    FYI: I will be going back to VS17 because it doesn't have the 10-15 second delay. Don't know what that is about.


     
  18. Deleted User

    Deleted User

    Guest

    Updating from 2020.3.8f1 to 2020.3.9f1 still had the issue that visual studio didn't find the unity packages. Closing VS and regenerating the project files before loading it again solved the issue.
     
  19. Saogeks

    Saogeks

    Joined:
    May 25, 2021
    Posts:
    1
    it worked perfectly, thank you very much for your good work
     
  20. tya280296

    tya280296

    Joined:
    Dec 28, 2020
    Posts:
    7
    Thank you!
     
  21. david_d_david

    david_d_david

    Joined:
    May 26, 2021
    Posts:
    2
    Thanks, it worked!
     
  22. ufo_zj

    ufo_zj

    Joined:
    Nov 7, 2018
    Posts:
    6
    Thanks for this. It works for me.
     
  23. Deleted User

    Deleted User

    Guest

    Thank you, This was a quick fix to an annoying problem.:)
     
  24. rigel_unity293

    rigel_unity293

    Joined:
    Jun 29, 2020
    Posts:
    13
    this fixed my issue as soon as I told it to use "Visual Studio community 2019" instead of "open by file extension"
     
  25. late-cretaceous

    late-cretaceous

    Joined:
    Jun 6, 2021
    Posts:
    1
    I was having this issue on macOS and, after following a whole chain of fixes from this thread, I got to the point where I received the following error message every time I opened the script in VS Code:

    "Some projects have trouble loading. Please review the output for more detail”

    To resolve this I needed to:
    • Download the latest version of Mono
    • Go into Preferences > Settings and search for "OmniSharp"
    • In "OmniSharp: Path" go into "Edit settings in.json" and add: "omnisharp.path": "latest"
    • Set "OmniSharp: Use Global Mono" to always
    Then it miraculously worked.

    This. took. me. forever. To figure out. Hopefully it helps someone else save some time!
     
  26. LelouchTheDemon

    LelouchTheDemon

    Joined:
    Jun 7, 2021
    Posts:
    2
    Thank you, this worked perfectly, but I had to select Visual Studio Community in the 'external script editor' drop down before it gave me an option to generate .csproj files. It didn't show me the option to generate .csproj files when it was set to 'open by file extension'
     
  27. undevable

    undevable

    Joined:
    Dec 25, 2020
    Posts:
    140
    Visual Studio for Mac is a bit weird to me, from switching to a Windows to a Mac. I was confused why there was no option to download any modules like Unity, Python, etc. It seems like VS for Mac has Unity Intellisense built-in, all I had to is update the intelligence through the package manager.
     
  28. kjayStudios

    kjayStudios

    Joined:
    Dec 8, 2014
    Posts:
    8
    For anyone this may help and apologies if this was mentioned and I missed it- I tried everything listed in this thread and still couldn't get Intellisense working. I tried clicking the button in Visual Studio that says "Attach to Unity" and then hit the little red stop button. Intellisense then worked perfectly.
     
  29. marck_ozz

    marck_ozz

    Joined:
    Nov 30, 2018
    Posts:
    107
    This works for me but now build for android takes a lot, like 16min.

    upload_2021-6-21_11-58-52.png
     
  30. mitko_dimitrov

    mitko_dimitrov

    Joined:
    Jun 21, 2021
    Posts:
    3
    Thank you very much!!!
    This solved the autocomplete issue and the syntax coloring!

    Wish you all the best!

    Regards,
    Mitko
     
  31. SteveMoore-MSG

    SteveMoore-MSG

    Joined:
    Jun 21, 2021
    Posts:
    1
    Thank you!!
     
  32. Maira57

    Maira57

    Joined:
    Jun 20, 2021
    Posts:
    1
    It worked perfectly.
    Thank you very much!
     
  33. ouryba49

    ouryba49

    Joined:
    Apr 5, 2021
    Posts:
    5
    All I can say is thank you for saving me browsing all the web.
     
  34. rAsor8888

    rAsor8888

    Joined:
    Jun 12, 2021
    Posts:
    3
    Worked in 2020.3.12f1 perfectly as well
     
  35. Lazius001

    Lazius001

    Joined:
    Mar 5, 2020
    Posts:
    7
    LifeSaver! I bookmarked this for next time if I forget.
     
  36. Contato

    Contato

    Joined:
    Oct 2, 2015
    Posts:
    16
    Unity 2019.4.19f1 with Visual Studio Community 2019 version 16.10.4 with Windows 10 fully updated.

    No Unity intellisense, it doesn't highlight even the classes I created, before this project I was using Unity 2017 and it was slightly less weird, but sill...

    I am trying everything I find on the internet.
     
  37. paulygons

    paulygons

    Joined:
    May 6, 2010
    Posts:
    164
    Updated VS then encountered "Visual Studio Can't Find Monobehavior". Needless to say, Intellisense wasn't working either. Unlike the OP (DavidG_Fenex) I switched External Script Editor to Open By File Extension, then double-clicked a script. The problem was already solved. Weird. I went on to follow OP's steps just to be sure. Everything is still groovy. Thanks David!
    VS update 2019 16.10.4, Unity 2020.3.14f1.
     
  38. alsimoes

    alsimoes

    Joined:
    Jun 25, 2021
    Posts:
    1
    It worked perfectly, thank you!
     
  39. KILLZO671

    KILLZO671

    Joined:
    Aug 8, 2021
    Posts:
    2
    THANK YOU SO MUCH BRO I AM SO HAPPY THANK YOU SO MUCH IM 11 AND IM TRYING TO MAKE GAMES FOR FUN TYSM!!!!!!!!!!
     
  40. ANEDSA

    ANEDSA

    Joined:
    Nov 24, 2016
    Posts:
    1
    [QUOTE = "DavidG_Fenex, post: 5527864, membro: 4514596"] Provavelmente, se você apareceu aqui nesta página, você está tendo o problema que tive na última hora ou assim. O Intellisense não está funcionando no Visual Studio. Para sua sorte, descobri a solução para corrigir esse problema depois de pesquisar em toda a web. Para que você não precise mais pesquisar na web, contarei como resolvi o problema.


    Passo 1:
    Fechar Visual Studio

    Passo 2:
    No Unity, vá para Editar <Preferências <Ferramentas Externas (parte esquerda da janela)

    Etapa 3:
    Em Ferramentas Externas, vá para a parte que diz Editor de Script Externo (deve ser em qualquer editor do Visual Studio que você está usando (para mim, o padrão é "Abrir por extensão de arquivo"

    Passo 4:
    Certifique-se de que a opção Gerar todos os arquivos csproj esteja marcada e a Anexação do Editor esteja marcada

    Etapa 5:
    Abra o script C # que você estava tentando abrir anteriormente

    Espero que isto ajude

    Atualmente usando
    - Unity 2019.3.3f1 Pessoal
    - Visual Studio 2019 [/ QUOTE]
    Origado, resolveu meu problema.
     
  41. pDarthModulus

    pDarthModulus

    Joined:
    Dec 12, 2018
    Posts:
    1
    There are several solutions here that will work to restore Intellisense functionality using Visual Studio and VSCode editors. However, I believe in my experience that the quoted method above is the true answer to the problem. The reason being, VS and VSC won't recognize the namespaces and other Unity Engine internals and keywords without having a Solution associated with the C# script file. I have no idea what causes this, but it simply won't recognize Unity engine namespaces, classes etc without it. In step 4 above, when you hit "Open C# Project" from the right-click context menu on a C# script file, this tells the selected editor to open a legit *project* for the source code - so, if there is previously no ".sln" and related items for the said project, it will default to creating them in the appropriate directory on your file system.

    As a sort of catch-all for anyone experiencing this problem, the summary of the solution to the entire issue is thus:

    1. Open Unity. In the editor, click on Window -> Package Manager.
      1. Scroll down the list of packages and ensure the Visual Studio Editor and/or the Visual Studio Code Editor packages have a green checkmark next them (meaning, they are installed).
    2. In the Unity editor, click on Edit -> Preferences to bring up the Preferences window.
      1. Click on the External Tools option.
      2. At the top of the right column in the window, you should now see an option for External Script Editor. Ensure that it does NOT read "Open by file extension." Instead, you will want to choose the correct version of Microsoft Visual Studio 20[xx] or Microsoft Visual Studio Code that you have installed on your machine.
      3. Ensure that everything under "Generate .csproj files for" is checked to true.
      4. Just to be certain they're all up to date, click the Regenerate Project Files button.
    3. If your issues persist, close Microsoft Visual Studio and in the Unity Editor, click Assets -> Reimport All. After Unity reloads, find the script file in your project that you were wanting to work with, right-click it and choose the Open C# Project option from the context menu.

    Again, there may be other issues as stated above for this problem. Maybe you as the user do not have the correct Packages installed/enabled in the Unity editor? Double check that. As of this writing (Aug 16, 2021) there does not seem to be any Unity Debugger extension for Visual Studio 2019; I double checked (though there may be for VSCode, so feel free to look that up just in case). If you feel that Visual Studio is not geared for use with Unity, you can always double check it by opening the Visual Studio Installer program, click Modify, and then ensure that under the "Gaming" subsection, the "Game Development with Unity" check box is checked true. You'd of course then click the Modify button if you made any changes, and make sure while you have it open that you're using the latest version.

    I know it was a bit wordy, but I hope this summary further helps anyone else turning to this thread for issues regarding Intellisense not functioning between Unity and Visual Stuido or Visual Studio Code. It was written as of Unity 2021.1.16f1, and Visual Studio 2019 (VS 2022 is yet in Beta)! :)
     
  42. f_riz123

    f_riz123

    Joined:
    Jul 2, 2021
    Posts:
    1
    I was also having the same issue that IntelliSense was not working. I am currently using Unity 2021 and using Visual Studio Code as my IDE. What I did was that I went into settings in Visual studio > Text Editor > Suggestions and then I enabled Inline Suggest (I'll include a screenshot) and then Intellisense began working. Screenshot.JPG
     
  43. ssidimoh

    ssidimoh

    Joined:
    Aug 18, 2021
    Posts:
    1
    Bro idk how to thanks you. You just fin the solution i was searching for hours.
    God bless you and make you steve Job
    Anas
     
  44. PinkPaprika

    PinkPaprika

    Joined:
    Aug 23, 2021
    Posts:
    1
    Thank you so much !
     
  45. unity_4Zkn_ieRRmAJNg

    unity_4Zkn_ieRRmAJNg

    Joined:
    Jul 30, 2021
    Posts:
    1
    Life saver... This type of people undoubtedly go to heaven c:
     
  46. rasim989

    rasim989

    Joined:
    Sep 3, 2021
    Posts:
    1
    Trust me or not but you are a life saver. Thanks pal. Appreciate your work.
     
  47. WritingOfCuddles

    WritingOfCuddles

    Joined:
    Sep 3, 2021
    Posts:
    1
    thank you thank you and thank you. this was driving me crazy not having intellisense not working
     
  48. Meteoroetem

    Meteoroetem

    Joined:
    Sep 4, 2021
    Posts:
    1
    That worked, thanks!
     
  49. Konikiewicz

    Konikiewicz

    Joined:
    Sep 5, 2021
    Posts:
    1
    OMG so much time waisted on this issue.... after doing most hints I read here, I had to do one more step. I hope it will be helpful for the others newcomers ;-)

    1. Open any script from within Unity so that visual studio opens.
    2. Locate solution explorer - for some reason, i had it hidden on the right side of my screen (not my standard layout)
    3. Right click on your solution and select Resolve Errors

    This fixed my problem. Good luck!
     

    Attached Files:

    Matt-Face, granit and davidborbis like this.
  50. CatherineChambers

    CatherineChambers

    Joined:
    Aug 26, 2021
    Posts:
    1
    Thanks so much exactly what was needed.