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

Can't debug with VS Code

Discussion in 'Editor & General Support' started by giofrida, Jan 15, 2018.

  1. giofrida

    giofrida

    Joined:
    May 21, 2017
    Posts:
    2
    Greetings,

    I can't seem to debug Unity projects via Visual Studio Code. I'm using the Debugger For Unity extension for VS Code, v. 1.2.1. Thing is, after combing through the forums and issue tracker on Github without success, I decided to try on my laptop with the same configuration and, surprise, it works, while on my desktop it just won't, no matter how many times I tried. I can't figure out what the problem is.

    My config:
    - Windows 7 Ultimate 64 bits;
    - Unity 2017.2.0f1 64 bits, Personal → decided to update to latest (2017.3.0f3) after discovering that that the latter works on my laptop;
    - VS Code 1.19.2 (tried both x86 and x64 on both machines, either works on my laptop);

    I tried with an empty project too. When I launch the debugger on VS Code I get the following output, before and after I begin Play mode on Unity:

    Afaik, the only difference between desktop and laptop is that I was getting way more (sub)entries in the call stack section on the latter.
    The problem is that the debugger just won't pause at breakpoints.

    Other infos:

    - My PATH env. variable:
    Code (csharp):
    1. C:\ProgramData\Oracle\Java\javapath;
    2. C:\Program Files\Haskell\bin;
    3. C:\Program Files\Haskell Platform\8.2.1\lib\extralibs\bin;
    4. C:\Program Files\Haskell Platform\8.2.1\bin;
    5. D:\Cygwin64\bin;
    6. c:\program files (x86)\intel\icls client\;
    7. c:\program files\intel\icls client\;
    8. c:\windows\system32;
    9. c:\windows;
    10. c:\windows\system32\wbem;
    11. c:\windows\system32\windowspowershell\v1.0\;
    12. c:\program files (x86)\intel\intel(r) management engine components\dal;
    13. c:\program files\intel\intel(r) management engine components\dal;
    14. c:\program files (x86)\intel\intel(r) management engine components\ipt;
    15. c:\program files\intel\intel(r) management engine components\ipt;
    16. c:\python27;
    17. c:\program files\openvpn\bin;
    18. c:\program files (x86)\windows kits\8.1\windows performance toolkit\;
    19. c:\program files\microsoft sql server\client sdk\odbc\110\tools\binn\;
    20. c:\program files (x86)\microsoft sql server\120\tools\binn\;
    21. c:\program files\microsoft sql server\120\tools\binn\;
    22. c:\program files\microsoft sql server\120\dts\binn\;
    23. c:\program files (x86)\skype\phone\;
    24. C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
    25. C:\Program Files\doxygen\bin;
    26. C:\Program Files\Haskell Platform\8.2.1\mingw\bin;
    27. C:\Program Files (x86)\GtkSharp\2.12\bin;
    28. C:\ProgramData\chocolatey\bin;
    29. C:\Program Files\dotnet\;
    30. C:\Program Files (x86)\Microsoft VS Code\bin
    - MonoDevelop's debugger works;
    - I have intsalled the OmniSharp C# For Visual Studio Code extension for VS Code;
    - I tried a complete re-install of both programs, again without success;
    - I also tried using dotBunny's VSCode plugin for Unity, but it hasn't been of help thus far (note: Unity crashes on exit if I enable it);
    - Control panel shows only one instance of the .NET Core SDK installed, I don't know if it's important.


    Any ideas? Thanks in advance for any help.
     
  2. sureshams

    sureshams

    Joined:
    Jun 7, 2017
    Posts:
    1
    Facing the same problem. Anyone with any suggestion, anyone from Unity who can help??
     
  3. giofrida

    giofrida

    Joined:
    May 21, 2017
    Posts:
    2
    Sorry for not posting an update, figured nobody else was having the same problem. Try with the Insiders version of VS Code, it worked for me.
     
  4. Vecna

    Vecna

    Joined:
    Apr 2, 2014
    Posts:
    31
    Also make sure you have Editor Attaching enabled in External Tools. :eek:
    upload_2020-6-8_16-30-27.png
     
    zhaoyuning likes this.
  5. zhaoyuning

    zhaoyuning

    Joined:
    Jul 9, 2021
    Posts:
    1
    thank you very much!
     
  6. peterfiftyfour

    peterfiftyfour

    Joined:
    Jan 8, 2016
    Posts:
    20
    You could also try running unity as an administrator - that worked for me.