Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

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

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

  1. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,892
    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:
    1,487