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

OpenFileAtLineExternal() not working with VisualStudio Community 2019

Discussion in 'Editor & General Support' started by Kastenfrosch2, Oct 11, 2019.

  1. Kastenfrosch2

    Kastenfrosch2

    Joined:
    Mar 19, 2017
    Posts:
    10
    When i set VisualStudio Community 2019 as External Script Editor and call

    Code (CSharp):
    1. UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(filePath, 0);
    then either nothing happens or I get the attached ErrorMessage

    After unsuccessful googling, I found out that specifying the optional column parameter

    Code (CSharp):
    1. UnityEditorInternal.InternalEditorUtility.OpenFileAtLineExternal(filePath, 0, 0);
    did the trick and worked just fine.

    I filed a bug report for this behaviour, but it was closed, because InternalEditorUtility is an unsupported internal library.
    http://fogbugz.unity3d.com/default.asp?1189389_c5i364k2g4f1unps

    Perhaps this post helps anyone who stumbles into the same issue.
    (Experienced with unity 2019.2.8f1 and VS 16.3.2)
     

    Attached Files:

    dbdenny, Bodkin and Robert_Poienar like this.
  2. Wecica

    Wecica

    Joined:
    Jul 20, 2016
    Posts:
    27
    Thank you very much for this solution!