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 not working since 2019.2

Discussion in 'Editor & General Support' started by EarlyFeelings, Sep 12, 2019.

  1. EarlyFeelings

    EarlyFeelings

    Joined:
    Jun 10, 2018
    Posts:
    1
    Hi,

    after clicking on c# scripts in Unity, the VSCode editor won't open. If you open the file manually, intellisense is missing. I have the latest version of Visual Studio Code package and Unity. (2019.2.5f1, 1.1.2) This is happening since 2019.2, 2019.1 still works.
    Does someone actually managed to fix this thing?
     
    marcosfullstack likes this.
  2. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    145
    I have the same problem with Unity 2019.0b3 atm.
    VSCode also does not open if I just double click any of the script files in windows explorer.
    But this happens only for this specific Unity project folder. If I move the files to a different location they open fine (obviously also without intellisense)
    So I am not sure if this is a Unity bug or a VSCode bug or maybe even both.
    Also could not find any solution yet.
     
    marcosfullstack likes this.
  3. marcosfullstack

    marcosfullstack

    Joined:
    Sep 14, 2019
    Posts:
    1
    Hello friends I found a partial solution, my current version is 2019.2.5f1 I decided leaving the external script edit args empty, and put the absolute cumin of vscode, and when opening the script I click the right mouse and choose option open container folder, this way it opens vscode, I hope that with you
     
  4. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    442
    Same for me using version 1.1.2 of the VSCode package.
     
    Toshine likes this.
  5. aduchene

    aduchene

    Joined:
    Sep 19, 2018
    Posts:
    4
    It's starting to be a big issue. Not fixed in 2019.3 either...
     
    Toshine likes this.
  6. Domas_L

    Domas_L

    Unity Technologies

    Joined:
    Nov 27, 2018
    Posts:
    111
  7. aduchene

    aduchene

    Joined:
    Sep 19, 2018
    Posts:
    4
    Looks like when the support got from Unity to an extern package in the package manager, the support for visual code stopped working.
    It seems like a big regression...
     
    Toshine likes this.
  8. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    145
    @Domas_L we tried this on two machines but it still does not work
     
  9. Macklin

    Macklin

    Joined:
    Jun 13, 2015
    Posts:
    11
    Check out the issue linked above.

    Two workarounds/fixes include:
    1. Edit line 182 of VSCodeScriptEditor.cs from
    ProcessWindowStyle.Hidden
    to
    ProcessWindowStyle.Normal
    (details in the comments of the issue linked above). The external script editor should be set to the exe if you do this, otherwise the console window of the code.cmd instance will also be shown.
    2. OR set the external script editor to code.cmd (not exe) - in the bin folder of the VSCode install directory.

    If you have attempted to open VSCode beforehand, make sure to end these processes from the Task Manager (in the details tab). If you already have opened VSCode externally, this issue won't occur.
     
    Last edited: Oct 7, 2019
    PHL1, Batz_, JohnnieDyer and 2 others like this.
  10. Eralyen

    Eralyen

    Joined:
    Nov 2, 2015
    Posts:
    1
    Worked for me, thank you so much!
     
    Macklin likes this.
  11. JohnnieDyer

    JohnnieDyer

    Joined:
    Dec 5, 2013
    Posts:
    3
    Number 2 worked for me. Logged in just to say thanks
     
    Last edited: Oct 22, 2019
  12. Blinkq

    Blinkq

    Joined:
    Apr 19, 2015
    Posts:
    21
    Thank you, worked for me too.
     
  13. DaseinPhaos

    DaseinPhaos

    Joined:
    Nov 20, 2017
    Posts:
    7
    intellisense STILL kind of doesn't work under 2019.3+vscode w/ omnisharp 1.21.10

    All unity packages failed to be recognized by omnisharp.
    output suggests that it cannot find .csproj file associated with packages installed from the package manager:

    Code (CSharp):
    1. [warn]: OmniSharp.MSBuild.ProjectLoader
    2.         The referenced project 'Unity.Timeline.csproj' does not exist
    I personally cannot locate these files under my project folder either, but they are explicitly referenced by Assembly-CSharp.csproj and friends.
     
  14. anarcheril

    anarcheril

    Joined:
    Jan 8, 2013
    Posts:
    23
    [fail]: OmniSharp.MSBuild.ProjectLoader
    The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks


    Except 4.7.1 is installed. FFS.
     
  15. Cookiez

    Cookiez

    Joined:
    Nov 1, 2015
    Posts:
    13
    Any fix for that?
     
  16. Domas_L

    Domas_L

    Unity Technologies

    Joined:
    Nov 27, 2018
    Posts:
    111
    Have you tried installing .NET 4.7.1 Developers Pack? It is different from the standard .NET Runtime Framework. You can find it here: https://www.microsoft.com/en-us/download/details.aspx?id=56119
     
  17. Cookiez

    Cookiez

    Joined:
    Nov 1, 2015
    Posts:
    13
    Moments after I'd posted here I found the solution, pointing to code.cmd was not enough, I also had to check the generate .csproj files option and then go to Assets->OpenC#Project. After these steps everything started working fine once again.
     
    DaseinPhaos and Domas_L like this.
  18. Paul-Sinnett

    Paul-Sinnett

    Joined:
    Nov 12, 2010
    Posts:
    20
    In my experience, these fixes don't work unless you also kill every existing Visual Studio Code task from the Task Manager. You'll probably have a bunch of hidden ones (with no associated window) and no way to get rid of them other than killing each task manually. o_O
     
  19. Deleted User

    Deleted User

    Guest

    Hi, I know this doesn't add any useful information to the issue but got to get my frustration out..

    Sick and tired of Windows, so have switched to Ubuntu as everything I need should work out of the box on Linux. That being everything needed for game development! And the switch from VS 2019 to VSC shouldn't pose an issue.

    But after spending 6-7 hours installing and uninstalling according to all possible suggested solutions on the internet, I'm still not able to get VSC intellisense to work with Unity. So I feel forced to keep hanging on to windows. :( Only, and only because of missing Unity intellisense in VSC. Sigh.. :/

    Hope there will come a permanent fix for this in the near future.

    Should have been so easy, and instead frustrations!! :(

    Hope you all have found a working solution.. :)
     
  20. Deleted User

    Deleted User

    Guest

    Got it working.. Sigh..

    Section "Troubleshoot the package manager" on https://docs.microsoft.com/en-us/do...-ubuntu-1910#troubleshoot-the-package-manager
    Followed by a "sudo apt upgrade"

    Finally got it working 90%.. Still get error markings when using things like:

    using UnityEngine.UI;
    using TMPro;

    And references like
    public TextMeshProUGUI _testText;

    And intelliSense for TextMeshProUGUI Doesn't show "SetText" when typin "_testText."
    So kind of, working. :/ Maybe it's just TMP that is different.