Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Visual Studio - Cannot connect to Editor in order to debug

Discussion in 'Editor & General Support' started by Exsavio, Feb 11, 2016.

  1. Exsavio

    Exsavio

    Joined:
    Jul 30, 2013
    Posts:
    4
    Hi all,

    I have recently upgraded to the latest version of Unity from a version that predates the integration with MS Visual Studio. Since upgrading, I can no longer debug the scripts in my project when I run them in the editor.

    'Microsoft Visual Studio Tools for Unity 2.2.0.0 enabled' appears in About Unity. In External Tools of Unity Preferences 'Visual Studio 2015' is selected, along with the 'Editor Attaching' check box.

    I have imported the 'Visual Studio 2015 Tools' package into my project, but cannot see any menu items that are spoken of in the context of Visual Studio Tools 2013, so assume this step is no longer relevant. When selecting the files under 'UnityVS\Editor' the only selected platform is 'Editor' - I'm unsure what changing these settings will effect, so I've left them as default.

    Within VS2015, using the 'Attach Unity Debugger' brings up my machine/project and 'editor' as one of the options. I have tried connecting to that, as well as a combination of localhost IP's and ports (56000 and 56140).

    However, the outcome is always the same - whenever errors occur in the code, visible in the Unity console - these are not caught by VS2015. Breakpoints are never triggered.

    The closest I have been able to get to VS2015 connecting with the Unity Editor is through attaching to the process as I used to with Monodevelop. VS2015 halts the process upon an error, but only gives a cryptic message referencing memory addresses, and displays a 'Source not Available' screen if I select the 'break' option.

    Any help please?
     
  2. Immanuel-Scholz

    Immanuel-Scholz

    Joined:
    Jun 8, 2013
    Posts:
    221
    Try to delete UnityVS/Editor (and any other UnityVS files like the VersionSpecific) you have in your project. You don't need these anymore. Maybe they are interfering?
     
  3. Exsavio

    Exsavio

    Joined:
    Jul 30, 2013
    Posts:
    4
    Thanks for the suggestion. I had added these in after having these troubles thinking that I may have needed them. Having removed them now hasn't resolved the issue unfortunately.