none
how do i solve this error? RRS feed

  • Question

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

    ************** Exception Text **************
    System.ArgumentNullException: Value cannot be null.
    Parameter name: value
       at System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)
       at BrowserDene.Form1.j0hmJwhBlC2WKBp1DA(Object , Object )
       at BrowserDene.Form1.ClickLink(String url)
       at BrowserDene.Form1.<webBrowser1_DocumentCompleted>b__4(Object s, EventArgs ev)
       at System.Windows.Forms.Timer.OnTick(EventArgs e)
       at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3634 (GDR.050727-3600)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    BrowserDene
        Assembly Version: 1.2.0.5
        Win32 Version: 1.2.0.5
        CodeBase: file:///C:/Documents%20and%20Settings/kemal/Local%20Settings/Application%20Data/systemup.exe
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3634 (GDR.050727-3600)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3634 (GDR.050727-3600)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3636 (GDR.050727-3600)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    Microsoft.mshtml
        Assembly Version: 7.0.3300.0
        Win32 Version: 7.0.3300.0
        CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.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.
    • Moved by Barry Wang Tuesday, June 5, 2012 5:55 AM (From:.NET Framework Setup)
    Sunday, June 3, 2012 10:49 AM

Answers

  • Hi, 

    Error is exactly because of .IndexOf(string value , value, string to seek,  is null.


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".


    Tuesday, June 5, 2012 4:05 PM
  • What line of code are you failing at? It appear that you are failing at the line of code below and the string is either Null or one of the parameters is invalid.

    System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)


    jdweng

    Sunday, June 3, 2012 11:31 AM
  • You need to test for null before using indexof.

    if(value != null)

    {

       int i = System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)

    }


    jdweng

    Tuesday, June 5, 2012 4:16 PM
  • As others have indicated the error and stack trace are telling you rather specifically that you are passing null as the value parameter to string.IndexOf(value);  You need to determine the cause of the error.

    You need to walk backward in your code from the point of failure and figure out why it's null.  Usually in my code this equates to something I forgot to do.

    If your build is set up to include debug info, copying the PDB file along side your assembly will cause line numbers to appear in the stack trace the next time you re-create the error.  This could be useful if you're using stirng.IndexOf in many different places.


    This signature unintentionally left blank.

    Tuesday, June 5, 2012 5:58 PM

All replies

  • What line of code are you failing at? It appear that you are failing at the line of code below and the string is either Null or one of the parameters is invalid.

    System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)


    jdweng

    Sunday, June 3, 2012 11:31 AM
  • Hi, 

    Error is exactly because of .IndexOf(string value , value, string to seek,  is null.


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".


    Tuesday, June 5, 2012 4:05 PM
  • You need to test for null before using indexof.

    if(value != null)

    {

       int i = System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)

    }


    jdweng

    Tuesday, June 5, 2012 4:16 PM
  • As others have indicated the error and stack trace are telling you rather specifically that you are passing null as the value parameter to string.IndexOf(value);  You need to determine the cause of the error.

    You need to walk backward in your code from the point of failure and figure out why it's null.  Usually in my code this equates to something I forgot to do.

    If your build is set up to include debug info, copying the PDB file along side your assembly will cause line numbers to appear in the stack trace the next time you re-create the error.  This could be useful if you're using stirng.IndexOf in many different places.


    This signature unintentionally left blank.

    Tuesday, June 5, 2012 5:58 PM