debugger skipping lines - not sure why RRS feed

  • Question

  • I have this sub routine:

    Private Sub LoadCombo()
        Dim StreetAdapter As OleDbDataAdapter
        Dim dTable As DataTable
        Dim oConn As OleDbConnection
        oConn = New OleDbConnection(connection.ConnString)
        StreetAdapter = New OleDbDataAdapter("SELECT * FROM Street ORDER BY StreetName ASC", oConn)
        dTable = New DataTable
        Me.StreetCombo.ColumnWidths = ComboBoxWidths
        bsData.DataSource = dTable
        Me.StreetCombo.DataSource = bsData
      End Sub

    If I set a breakpoint on the first line, when I run the debugger it moves the breakpoint to the oConn = New OleDBConnection.... line.

    Then after it steps on to that line, it skips everything else in the sub. I don't get any exceptions.

    I am very confused by this.


    Saturday, July 23, 2011 11:57 PM

All replies

  • I get "jumping breakpoints" during debugging, when symbol file (*.pdb) does not match source-file(s). For example, when I change source-code, and Visual Studio does not rebuild the assembly/symbol-file, because in "Solution Property Pages->Configuration Properties->Configuration" "Build" is not checked.

    With kind regards

    Sunday, July 24, 2011 10:56 AM
  • Hi Maybe

    Thanks for taking the time to respond. I checked those settings and the Build is checked.


    Sunday, July 24, 2011 2:05 PM
  • Probably you may try another test:
    Can you check under "Tools->Options" "Debugging General" "Require source files to exactly  match the original version" and uncheck "Enable Just My Code" (not sure the latter is necessary).
    Insert a System.Diagnostics.Debugger.Break() in LoadCombo(). Start your assembly through explorer. When the jit-debugger pops up: will the source-line with this command will be hit?

    With kind regards

    Sunday, July 24, 2011 3:33 PM
  • That did not work as well. Very strange. Just does not hit that code.
    Monday, July 25, 2011 12:19 AM
  • Now I am just guessing ...
    When you say, with code is not hit, jit debugger is not popping up (no exception), then I would double check after rebuild (you must build in debug-config, and code must be in execution-path): are there in Output window no errors during rebuild (are all projects in solution built/updated). Do src-files in project match the ones you have opened in VS. In explorer verify: are the time-stamps of exe, pdb, source files reasonable (up-to-date)? Are they in the expected folder (debug/release?). When you debug, are the paths of assemblies in Modules window the ones you just rebuild?

    But when you say, with code not hit, it just does show again wrong line (but jit-debugger does pop up, which indicates break is hit, regardless what source says)? Then sometimes, when code-optimization is turned on (which you find in project-properties under "Build"), lines will deviate. But I doubt to such extent.

    With kind regards

    Monday, July 25, 2011 4:44 PM
  • Here is what I am getting with a build:


    ------ Build started: Project: AccessComboBox, Configuration: Debug Any CPU ------
      AccessComboBox -> C:\R Sytsma Freelance\MultiColumnComboBox\MultiColumnComboBox\AccessComboBox\bin\Debug\AccessComboBox.dll
    ------ Build started: Project: BurnPermits, Configuration: Debug Any CPU ------
    vbc : warning BC40059: A reference was created to embedded interop assembly 'Accessibility' because of an indirect reference to that assembly from assembly 'AccessComboBox'. Consider changing the 'Embed Interop Types' property on either assembly.
    vbc : warning BC40059: A reference was created to embedded interop assembly 'Accessibility' because of an indirect reference to that assembly from assembly 'System.Windows.Forms'. Consider changing the 'Embed Interop Types' property on either assembly.
      BurnPermits -> C:\RLS\Clients\Inactive\Oshtemo Twp\Burn Permit\BurnPermits\BurnPermits\bin\Debug\BurnPermits.exe
    ------ Skipped Build: Project: burnpermitsetup, Configuration: Debug ------
    Project not selected to build for this solution configuration
    ========== Build: 2 succeeded or up-to-date, 0 failed, 1 skipped ==========


    Monday, July 25, 2011 5:05 PM
  • WTH

    Now it is doing the same type of thing with a C# project I am working on.

    I set a breakpoint on a form load event and it never even hits it or seems to fire that event.


    I must be doing something really wrong...

    Monday, July 25, 2011 5:19 PM
  • Could you please check whether the pdb file is loaded properly from correct folder, you can select Debug -> Windows -> Modules, on the Modules window, right click the symbol item, select Symbol Load Information, from the pop up window, you can see whether the pdb file is loaded and where the pdb file is loaded from.
    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 26, 2011 1:33 AM
  • Stop trying to debug in release mode...

    Paul Pleasant - WebTech One Inc.

    Saturday, January 2, 2016 4:14 AM
  • Rude way to put it, but that was the source of the problem. Thanks.
    Wednesday, September 11, 2019 10:37 PM