Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Bug (Case 1155383) Exception thrown while invoking [OnOpenAssetAttribute]

Discussion in '2019.3 Beta' started by Peter77, May 17, 2019.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,007
    Right-clicking in the Project window provides the ability to "Open" always. Clicking the "Open" context-menu button, while no asset is selected, displays an ArgumentOutOfRangeException.

    Exception thrown while invoking [OnOpenAssetAttribute] method 'Unity.CodeEditor.CodeEditor:OnOpenAsset (int,int,int)'
    ArgumentOutOfRangeException: startIndex cannot be larger than length of string.



    Reproduce
    • Open attached project or create a new one
    • Right-click in the Project window while no asset is selected
    • Choose "Open" from the context-menu

    Actual
    Unity outputs an ArgumentOutOfRangeException exception.

    Expected
    The "Open" button should be disabled if there is no selection.
     
    Render_Man likes this.
  2. Yishi_

    Yishi_

    Joined:
    Jun 12, 2017
    Posts:
    2
    workaround:-
    open Preferences, to External Tools and reselect Visual Studio from the dropdown menu, it should resolve the problem.
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,121
unityunity