Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Visual Studio Code Intellisense doesn't work with Unity 2018

Discussion in 'Scripting' started by CrowbarSka, Jul 30, 2018.

  1. jrosadogenera

    jrosadogenera

    Joined:
    Apr 23, 2018
    Posts:
    4
    Hi all,

    I have had the same problem with Unity v2019.3.6f1 and Visual Studio Code v1.43.1.

    I solved reinstalling Mono and Net Core to latest versions, deleting all csproj and sln files in the project's root, changing the default editor to Visual Studio and opening the project with it. After that I changed again the default editor to Visual Studio Code and now is properly working.
     
  2. ActiveSim

    ActiveSim

    Joined:
    May 10, 2019
    Posts:
    58

    I solved this problem by deselecting all options in Visual Studio Code, which try to connect with the internet by themself.
     
  3. Aykutkaraca

    Aykutkaraca

    Joined:
    Jan 4, 2018
    Posts:
    33

    Mono has the following suggestion on the download page:
    The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections.

    and choose your distro correct.

    https://www.mono-project.com/download/stable/
     
  4. Aykutkaraca

    Aykutkaraca

    Joined:
    Jan 4, 2018
    Posts:
    33
    I have had exactly the same problem with Unity v2019.3.6f1 and Visual Studio Code v1.43.1 on linux and I almost gave up and went back to Windowns but suddenly I realized that I had two repositories selected for Debian so I removed the wrong one and re-installed mono and also did this:

    $ export FrameworkPathOverride=/usr/lib/mono/4.5
    You should pick your own path to the mono explained here
    https://stackoverflow.com/questions...rk-netframework-version-v4-7-1-were-not-found
     
    phrobion likes this.
  5. jrosadogenera

    jrosadogenera

    Joined:
    Apr 23, 2018
    Posts:
    4
    Hi,

    sorry but my previous solution only works until Unity detects a change in Assets folders and recreates the sln an proj files :(

    Is an Unity problem/bug?
     
  6. Aykutkaraca

    Aykutkaraca

    Joined:
    Jan 4, 2018
    Posts:
    33
    are you on Linux? you should look at your "output" window at Visual Studio Code to see if there are any errors. You can click View/Output Window but choose "OmniSharp Log" to see that.
     
  7. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    475
    INSANE SOLUTION YOU WON'T BELIEVE IF ON MAC

    1. Download Rider (no, really)

    2. Install the Rider package manager inside Unity

    3. Probably restart every electronic device in your house

    4. Launch Unity, set the external script editor as Rider - launch

    5. Use Rider a few times, save, change files etc.

    6. Quit RIder and Unity

    7. Launch Unity - set the external script editor back to VSCode

    8. In the Project panel, double-click on a c# file, VSCode will open

    THE PROBLEM IS FIXED, VSCODE NOW WORKS

    WTF? Hope it saves someone some hours
     
    Alex_May likes this.
  8. HitGrab1

    HitGrab1

    Joined:
    Aug 22, 2018
    Posts:
    1
    Ok, for anyone who is experiencing similar issue here is a solution that works for me (Unity 2020.1.f2, Mac):

    First, install the latest build of mono:
    https://www.mono-project.com/download/stable/

    Then, on VSCode, go to settings-> "Omnisharp: Use global Mono" -> change it to always



    And then it works.
     
    ROBYER1, Its4u, Burglecut and 8 others like this.
  9. jamesp124

    jamesp124

    Joined:
    Oct 7, 2019
    Posts:
    7

    This worked for me on Ubuntu after updating both VSCode and Mono. Cheers!
     
  10. autowash

    autowash

    Joined:
    Oct 14, 2012
    Posts:
    18
    Can confirm this works (same setup as @HitGrab1). Thank you so much, can stop pulling my hair now!
     
  11. Nazdorovye

    Nazdorovye

    Joined:
    Aug 26, 2019
    Posts:
    1
    Works for me. Thanks!
     
  12. dhaynes_unity

    dhaynes_unity

    Joined:
    Jun 10, 2019
    Posts:
    2
    I'm on a Mac and this worked for me. Thank you!
     
  13. MarioHP

    MarioHP

    Joined:
    Dec 20, 2018
    Posts:
    1
    Saved my time... cheers....
     
  14. Bambivalent

    Bambivalent

    Joined:
    Jan 25, 2017
    Posts:
    16
    Same on Unity 2019.4.3. Thanks, good job!
     
  15. jeison_p

    jeison_p

    Joined:
    May 4, 2021
    Posts:
    1
    Thank you sir! o/
     
    fegabe likes this.
  16. Luthis

    Luthis

    Joined:
    May 20, 2020
    Posts:
    14
    Nothing worked for me, except changing the version of Intellisense in VSCode to a different (older) version. Then everything's been fine.