Search Unity

VS 15.8.5 not working with Unity 2018.2

Discussion in 'Editor & General Support' started by madks13, Sep 24, 2018.

  1. madks13

    madks13

    Joined:
    May 8, 2016
    Posts:
    161
    Until i updated visual studio from 15.7.x to 15.8.5 i could atach visual studio to unity and debug properly. Now it doesn't work. For some obscure reason, after i attach visual studio to unity, if i press play or if the editor is already playing, it freezes until i stop debugging.

    I'm not sure what the problem is but i tried with 2018.2.7, 2018.2.8 and 2018.2.9 with, bivously, the same result.
     
  2. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,292
    If you try to open up a script does it say Visual Studio cannot open up your .sln file or command line won't be loaded or something similar?

    If it does, you can try this if you want (maybe make sure your project is backed up although I don't think it will hurt anything):

    I think it has to do with Visual Studio being dumb and not being able to find your project solution files...…. so to trick Unity into finding your solution files you can try below.

    In the Unity Editor, you can go to Edit->Preferences. Click on the "External Tools" tab. Then in "External Script Editor" dropdown option select "Browse" and browse your Windows folders for Notepad (I had to find the Notepad.exe on Windows first then I could navigate to it). Once you have Notepad selected as your External Script Editor, open one of your scripts (it should open with Notepad). Close it, and now switch back the External Script Editor to using your version of Visual Studio you are using. Unity should now find your .sln solution file again.

    Not sure if that will fix your particular problem, but it's something you can try if you want.
     
  3. madks13

    madks13

    Joined:
    May 8, 2016
    Posts:
    161
    @Velo22 i don't have a problem with visual studio opening or editing the script files. Only when debugging.
     
  4. fabel

    fabel

    Joined:
    May 28, 2013
    Posts:
    4
    I am having the same issue @madks13 but i am running Visual Studio 15.8.4 and Unity 2018.2.9f1
     
  5. devluz

    devluz

    Joined:
    Aug 20, 2014
    Posts:
    47
    It looks like something seriously broke. Both of my windows system can't attach the debugger anymore and can't open the Unity sln files anymore. Visual Studio Tools for Unity doesn't show up in Visual Studio anymore. Only a third system still works which was offline for the past month which makes me think an update most have broken it.

    Visual Studio 2017 15.8.5
    Unity 2017.4.10f LTS
    Visual Studio Tools for Unity 3.8.0.7

    My older system where it still works:
    Visual Studio 2017 15.8.3
    Unity 2017.4.10f LTS
    Visual Studio Tools for Unity 3.8.0.6
     
  6. jbevain

    jbevain

    Microsoft

    Joined:
    Feb 22, 2012
    Posts:
    136
    Hello thread,

    From your description it does look like the update somehow went wrong and the Tools for Unity are indeed not registered with Visual Studio. Not good but should be an easy fix

    Close all VS instances,
    Open a «Developer Command Prompt for Visual Studio 2017» from the start menu as an Administrator (important), and run:

    devenv.exe /setup

    This will force VS to reload all its extensions.
     
  7. madks13

    madks13

    Joined:
    May 8, 2016
    Posts:
    161
    @jbevain nope, tried debugging and still won't play the game when VS is attached to it.
     
  8. kaffiene

    kaffiene

    Joined:
    May 26, 2013
    Posts:
    21
    I have the same issue as @madks13 . @jbevain 's fix doesn't work for me.
    Unity 2108.2.12f1
    VS:15.8.2
     
  9. madks13

    madks13

    Joined:
    May 8, 2016
    Posts:
    161
    For all those having the same issue : when i updated VS the problem went away. It seems something within VS causing the problem was fixed. I have yet to encounter the same problem i had.

    The current versions i have are :
    Unity 2018.2.9f1 to 2018.2.13f1
    VS 15.8.7
    VS Tools for Unity 3.8.0.7