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

  • Question

  • I cannot reproduce that error. My client got following error:

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.InvalidCastException: Operator '=' is not defined for type 'DBNull' and string "".
       at Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(Object Left, Object Right, Boolean TextCompare)
       at FileProperties.frmReports.KeepPastRetention(DataTable& dt)
       at FileProperties.frmReports.frmReports_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.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.0.30319.36365 built by: FX452RTMLDR
        CodeBase:
    ----------------------------------------
    FileProperties
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase:
    ----------------------------------------
    Microsoft.VisualBasic
        Assembly Version: 10.0.0.0
        Win32 Version: 12.0.52365.36365 built by: FX452RTMLDR
        CodeBase:
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34294 built by: FX452RTMGDR
        CodeBase:
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.36365 built by: FX452RTMLDR
        CodeBase:
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34251 built by: FX452RTMGDR
        CodeBase: ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34285 built by: FX452RTMGDR
        CodeBase:
    ----------------------------------------
    System.Runtime.Remoting
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34245 built by: FX452RTMGDR
        CodeBase: ----------------------------------------
    TreeViewFileBrowser
        Assembly Version: 1.0.6404.20968
        Win32 Version: 1.0.0.0
        CodeBase:
    ----------------------------------------
    System.Data
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34297 built by: FX452RTMGDR
        CodeBase:
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34283 built by: FX452RTMGDR
        CodeBase:
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase:
    ----------------------------------------
    Accessibility
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.36365 built by: FX452RTMLDR
        CodeBase:
    ----------------------------------------
    System.Transactions
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase:
    ----------------------------------------
    System.EnterpriseServices
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase:
    ----------------------------------------
    System.Numerics
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
        CodeBase:
    ----------------------------------------
    GenLib
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase:
    ----------------------------------------
    System.Web
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.36365 built by: FX452RTMLDR
        CodeBase:
    ----------------------------------------
    ZLP
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase:
    ----------------------------------------
    ************** 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.

    Friday, August 18, 2017 5:26 PM

All replies

  • Looks like an issue with 

    System.InvalidCastException: Operator '=' is not defined for type 'DBNull' and string "".
    If checking a string use String.IsNullOrWhiteSpace.


    Please remember to mark the replies as answers if they help and unmark 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.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, August 18, 2017 7:12 PM
    Moderator
  • Hi Michel-Andre,

    Based on your description, you want to use Just-In-Time Debugging in your application, but you have some issue about JIT, am I right?

    By default, Windows Forms applications have a top-level exception handler that allows the program to continue to run if it can recover.

    Please note:

    In order for this procedure to work in a release configuration, you need to turn off Just My Code. In Visual Studio, click Tools / Options. In the Options dialog, select Debugging. Remove the check from Enable Just My Code.

    Here is the detailed step about using Just-In-Time Debugging, please refer to:

    https://msdn.microsoft.com/en-us/library/5hs4b7a6.aspx

    Best Regards,

    Cherry


    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.

    Monday, August 21, 2017 2:57 AM
    Moderator