Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Can't open C# editor

Discussion in '2019.3 Beta' started by Zymes, May 23, 2019.

  1. Zymes

    Zymes

    Joined:
    Feb 8, 2017
    Posts:
    106
    I can't open any scripts from within the Unity Editor to launch VS2017 or VS Code.
     
  2. Matt_De_Boss_Developer

    Matt_De_Boss_Developer

    Joined:
    Oct 17, 2014
    Posts:
    36
    Same here, its just frozen
     
  3. miniwolf_unity

    miniwolf_unity

    Unity Technologies

    Joined:
    Apr 10, 2018
    Posts:
    69
    What version of the individual packages are you using? There are new Visual Studio Editor, and Visual Studio Code Editor packages. The newest versions are 1.0.11, and 1.0.7 respectively.
     
  4. spooneystone

    spooneystone

    Joined:
    Feb 1, 2015
    Posts:
    11
    Thanks for the solution @miniwolf_unity !!! i had same problem, only that i forgot to update the packages after upgrading my project to 2019.3.
     
  5. Randhall

    Randhall

    Joined:
    Feb 21, 2013
    Posts:
    12
    Hey guys are you running windows?
    I am running macOS Mojave Version 10.14.6 on a MacBook Pro and VS Code still doesn't work for me.

    I do have the Visual Studio Code editor Package version 1.0.7 (It's a new project created with unity hub natively targeting the beta 2019.3.0b1) when i double click any c# file in the editor VS Code opens but on the welcome screen and neither the file is opened nor the project is properly opened in VS Code.
     
  6. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    341
    Opening VS Code doesn't work right. VS Code opens but doesn't get the project, nor does it open the file.

    Windows, latest VS Code, latest VS Code Editor package (1.07) on 2019.3 Beta
     
  7. zackblack

    zackblack

    Joined:
    May 17, 2015
    Posts:
    23
    I just started having this issue this morning. It was working perfectly fine yesterday and nothing has updated. Anyone have a solution? Other Unity project open just fine - but not the one I was working on. I even tried deleting all of the .csproj files and they just get re-created.
     
  8. JohnC_Unity

    JohnC_Unity

    Unity Technologies

    Joined:
    Jun 7, 2017
    Posts:
    42
  9. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    33
    I haven't tried updating to the preview package yet, but it seems to be opening several copies of VS Code when double clicking from the editor. if you open task manager you can see they're all located under the Unity Editor Drop down. If you End those tasks and open VS Code separately it all works properly, not sure if this info helps or not!

    Edit: Updated to 1.1.2 but still having the same issue :(. I can send more info if you need anything. Also not 100% sure but I THINK this might only be a project upgrade issue, I tried creating a new project and it seemed to work fine but i'd need to test a bit more to be sure
     
    Last edited: Sep 9, 2019
    EvOne and JohnC_Unity like this.
  10. kevwills

    kevwills

    Joined:
    Feb 9, 2018
    Posts:
    3
    Hi, I was having a similar issue. In addition to what others stated, when I selected "External Script Editor" as Visual studio code, under the preferences-> external tools. Unity would try to open every asset in VSCode. This included trying to switch between scenes. I set the External script editor to 'Open by file extension' this solved the assets, but removed the functionality of the code editor. Reading the comments on this post, I went to package management and updated the VSCode package to 1.1.2, I was then able to go back and set the external script editor back to VSCode, and everything works properly now. Hope others have the same luck.
     
    EvOne and JohnC_Unity like this.
  11. JohnC_Unity

    JohnC_Unity

    Unity Technologies

    Joined:
    Jun 7, 2017
    Posts:
    42
    If it's still happening then yes please, submit a bug report along with the project files. Once submitted let me know the bug ID and i can take a look.
     
    EvOne likes this.
  12. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    37
    Having the same issue here. Double-click on a script, or click 'Open C# Project', and nothing opens. All it does is launch a bunch of Visual Studio Code processes in Windows 10 task manager. It's happening in 2019.2, too, even when using the latest Visual Studio Code Editor package. What's weird about it is, if I create a new Unity project it works fine, but once I restart the computer it stops working for the new project too. I've had to downgrade to Unity 2019.1 where everything continues to work fine (probably because that version doesn't depend on the Visual Studio Code Editor package).
     
  13. Anthony0506

    Anthony0506

    Joined:
    Oct 13, 2016
    Posts:
    73
    unity 2019.2

    having this issue for the last week or so. click a script, never opens. open task manager, says code editor is open under unity, but it never actually opens. reinstalled package manager vscode file, updated vscode, nothing.

    if i copy the project and delete my old one, sometimes it'll work right until i have to close the project. anyone figure this out?
     
  14. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    341
    Yup having the exact same issue. Can't work with VS Code much at all.
     
  15. Anthony0506

    Anthony0506

    Joined:
    Oct 13, 2016
    Posts:
    73
    it sucks because vs community is bloated and slow. i hope they prioritize this.
     
  16. Amir-Ward

    Amir-Ward

    Joined:
    Jan 26, 2015
    Posts:
    30
    Broken for me too on 2019.2.5f1 using package 1.1.2
     
    Toshine likes this.
  17. ahmadpi

    ahmadpi

    Joined:
    Aug 23, 2017
    Posts:
    2
    Same thing happened to me. Tried to reinstall Unity and VSCode still not helping. Help!
     
  18. mccann

    mccann

    Joined:
    Sep 24, 2013
    Posts:
    29
  19. Anthony0506

    Anthony0506

    Joined:
    Oct 13, 2016
    Posts:
    73
    how are you setting vscode to use the .cmd file?
     
  20. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    37
    The cmd workaround was exactly what I needed, thanks!

    Try going to preferences in Unity, and select the External Tools tab. In the External Script Editor drop-down menu select Browse, and in the open dialog set the file type to All Files. Go to the directory where Visual Studio Code is installed on your computer ("C:\Users\USER_NAME\AppData\Local\Programs\Microsoft VS Code" for me), and there should be a folder called bin. Open it, and then select code.cmd. Unity should automatically set everything up, and VSCode should now work again.

    This is on Windows, I'm not sure how different it would be on Mac or Linux.