5.0 SP1 Debugger Bug?

bhalpinbhalpin Member Posts: 309
Ok, after seeing this about 20 times today, I'm pretty sure I'm not crazy.

I run a codeunit and notice a problem.

I edit the codeunit. I save it, compile it, etc.

I run the codeunit and see the same problem.

I edit the codeunit and set a breakpoint at/near the place I made the changes (which are visible), and close the editor window. (No change to the code whatsoever.)

I enable the debugger and run the codeunit.

The debugger pops up at the breakpoint and I look around and my code changes are *not there*.

What the ... ?

I exit NAV and restart.

I enable the debugger and run the codeunit.

The debugger pops up on the breakpoint and this time my code change *is there*.

Am I on the wrong meds or something?

Bob

Answers

  • DenSterDenSter Member Posts: 8,305
    do you mean the debugger has the old version of your code in cache or something?
  • bhalpinbhalpin Member Posts: 309
    Yup.
  • DenSterDenSter Member Posts: 8,305
    Does it happen while the debugger is still sitting out there, or do you close it between runs? Have you tried closing the debugger between runs?

    Never seen that before. If that's the case though, nothing you can do about it. Close the debugger, close NAV, restart NAV and debug again. It's a pain in the bootie, but if that's how it works that's how it works. Report it to MSFT and hope it'll be addressed in a hotfix.
  • ara3nara3n Member Posts: 9,256
    I've seen this, and yes the debugger caches the old version. You have to close the debugger afterwords.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bhalpinbhalpin Member Posts: 309
    Hi.

    I close the debugger between runs.

    I learned the hard way what happens if you have extra windows open on C/AL code - you know - losing all your changes when you close the out-of-date window and answer Yes to the save prompt? (Haven't been bitten by this yet? Wait, you will. And you don't forget it!) #-o

    So, I'm very consious of what windows are open.

    I'll try it a few more times just to be sure before I report it to MS though.

    Bob
  • DenSterDenSter Member Posts: 8,305
    it would suck if you have to restart NAV as well as the debugger. It's not going to improve anyone's productivity
  • jlandeenjlandeen Member Posts: 524
    I find that when I'm developing it's always best to set the object cache to 0 (the default is 320000). This way I can guarantee that I'm always loading the latest & greatest objects (especially important if there are other developers in the same DB and I need to have access to their changes).
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • bhalpinbhalpin Member Posts: 309
    I experienced this in a db under a NAV server, and a copy of the database opened locally.

    Bob
  • jlandeenjlandeen Member Posts: 524
    What is your Object Cache set too?
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • bhalpinbhalpin Member Posts: 309
    Checked object cache. It is 32000
    Changed it to zero. Closed and reopend database.
    Confirmed cache is still 0
    Ran a given codeunit
    Edited codeunit by insering a new code line (not comment)
    Closed, compiled and ran the codeunit
    Edit the codeunit and set a breakpoint on line above new line
    Closed codeunit window
    Enabled debugger
    Ran codeunit
    Debugger comes up at correct breakpoint
    New code line inserted previously not visible in debugger.
    Conclusion: :bug:
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Which codeunit by the way? I ask becasue Codeunit 1 and anything launched in it is cached till you close and reopen NAV, and there is NO way around that.
    David Singleton
  • DenSterDenSter Member Posts: 8,305
    Oh I hadn't even though about that. This aplies to all single instance codeunits. Once those are started they live on in memory, and they will not pick up changes that you make until after you restart NAV. Like David says, there is no way around that, it is the nature of single instance codeunits.
  • bhalpinbhalpin Member Posts: 309
    That's It!!! \:D/

    It is a single-instance codeunit!

    Problem solved!

    Thanks to everyone who contributed.

    Bob

    P.S. Mibuso RULES!
  • DenSterDenSter Member Posts: 8,305
    Good, glad you made that work :mrgreen: and yes Mibuso does rock :-({|= (bluegrass style ;))

    You know the ironic thing is I spent literally days trying to come to terms with the same issue, so I am kicking myself for taking so long to suggest that. ](*,)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    DenSter wrote:
    Good, glad you made that work :mrgreen: and yes Mibuso does rock :-({|= (bluegrass style ;))

    You know the ironic thing is I spent literally days trying to come to terms with the same issue, so I am kicking myself for taking so long to suggest that. ](*,)

    I had the issue in the very early days trying to add some password enhancements for a client in 1.3, took us a long time to figure it out, so it alwasy ssticks in my head. Recently I was using Ahmeds brilliant little single instance thing to find consistant errors, and had the same issue, and still remembering that earlier instance, I worked it out in minutes instead of days.
    David Singleton
Sign In or Register to comment.