none
Net Framework less than zero error RRS feed

  • Question

  • Hi,

    I am using a software for Vive Calibration on Windows 7 64 and I receive a /NET Framework error

    'Length cannot be less than zero'

    I have installed all the requirements for it (Visual C 2005, 12, 13 and so on)

    Can someone help me?

    Thank you,

    ......................................................................................

    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.
    Parameter name: startIndex
       at System.String.Substring(Int32 startIndex, Int32 length)
       at MI6DiagnosticTool.DiagFunctionHMD.HMD_CheckDeviceOnline(String number)
       at MI6DiagnosticTool.DiagFunctionHMD.Invoke(String key, String number)
       at MI6DiagnosticTool.DiagForm.button1_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3416.0 built by: NET472REL1LAST_B
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    MI6DiagnosticTool
        Assembly Version: 1.0.0.2
        Win32 Version: 1.0.0.2
        CodeBase: file:///C:/HTC/MI6_Diagnostic_Tool/MI6_Diagnostic_Tool/MI6DiagnosticTool.exe
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3451.0 built by: NET472REL1LAST_C
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3429.0 built by: NET472REL1LAST_C
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Web.Services
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3062.0 built by: NET472REL1
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Services/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
    ----------------------------------------
    MI6DiagnosticTool.XmlSerializers
        Assembly Version: 1.0.0.2
        Win32 Version: 1.0.0.2
        CodeBase: file:///C:/HTC/MI6_Diagnostic_Tool/MI6_Diagnostic_Tool/MI6DiagnosticTool.XmlSerializers.DLL
    ----------------------------------------
    System.Data
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3260.0 built by: NET472REL1LAST_C
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
    ----------------------------------------
    System.Transactions
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
    ----------------------------------------
    System.EnterpriseServices
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3062.0 built by: NET472REL1
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
    ----------------------------------------
    System.Numerics
        Assembly Version: 4.0.0.0
        Win32 Version: 4.7.3062.0 built by: NET472REL1
        CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    --------------------------------------------------------------------------

    Tuesday, October 29, 2019 10:12 AM

Answers

  • Hi Marian,

    Thank you for posting here.

    For your question, you receive an error: StartIndex cannot be less than zero.

    I noticed that you are using String.SubString(), so I reproduce your error.

    This error occurs when you use Indexof() to get the index of a non-existing character.

    You could check your string to rule out this error.

    If it still exits the problem, please provide the related code.

    Hope my solution could be helpful.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Marian Jax Wednesday, October 30, 2019 12:20 PM
    Wednesday, October 30, 2019 5:58 AM
  • Actually I think it's more likely that the length parameter of .Substring() or other segmenting functions is negative value.

    This usually occurs when parameter passing class initialize the values to -1, then don't fill it in some code path, and use this parameter as the length parameter.

    Alternatively, if it's really thrown in .SubString() function, maybe a previous search on substring return bogus value, and the code use it to calculate the remaining characters to fetch from the original string, causing the total number of characters to fetch a negative value.

    The catpured error message could be from a irrelevent exception. (You see the wordings don't match)

    The asker really need to contact the developers of MI6DiagnosticTool to see what's going on.




    • Edited by cheong00Editor Wednesday, October 30, 2019 7:05 AM
    • Marked as answer by Marian Jax Wednesday, October 30, 2019 12:20 PM
    Wednesday, October 30, 2019 7:01 AM
    Answerer

All replies

  • The error message alone is not enough to know how you got this error, a guess is you sent an empty array or list for instance. Please provide more details.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Tuesday, October 29, 2019 1:30 PM
    Moderator
  • If you are the user of this product then you need to post your question in their forums. This forum is only for C#-specific questions. We do not provide product support here.

    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, October 29, 2019 1:55 PM
    Moderator
  • Hi Marian,

    Thank you for posting here.

    For your question, you receive an error: StartIndex cannot be less than zero.

    I noticed that you are using String.SubString(), so I reproduce your error.

    This error occurs when you use Indexof() to get the index of a non-existing character.

    You could check your string to rule out this error.

    If it still exits the problem, please provide the related code.

    Hope my solution could be helpful.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Marian Jax Wednesday, October 30, 2019 12:20 PM
    Wednesday, October 30, 2019 5:58 AM
  • Actually I think it's more likely that the length parameter of .Substring() or other segmenting functions is negative value.

    This usually occurs when parameter passing class initialize the values to -1, then don't fill it in some code path, and use this parameter as the length parameter.

    Alternatively, if it's really thrown in .SubString() function, maybe a previous search on substring return bogus value, and the code use it to calculate the remaining characters to fetch from the original string, causing the total number of characters to fetch a negative value.

    The catpured error message could be from a irrelevent exception. (You see the wordings don't match)

    The asker really need to contact the developers of MI6DiagnosticTool to see what's going on.




    • Edited by cheong00Editor Wednesday, October 30, 2019 7:05 AM
    • Marked as answer by Marian Jax Wednesday, October 30, 2019 12:20 PM
    Wednesday, October 30, 2019 7:01 AM
    Answerer