Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Cannot debug while select code block in managed code in VS2013

(0) ShareShare
ReportReport
Posted on by 115

I'm trying to debug a batch job, and while I got the code to break at the run method, when I attempt to step through the while select statement, the debugger skips all the way to the last statement of the while select code block (at the last iteration as well).  I've double checked that the while select will return at least 1 or more rows, and it always skips to the last statement in the code block which means it is entering it.  I don't understand why this happens, and need to know if there's any way to force the debugger to break at the start of the code block.  I'm guessing that sql statements in managed code cannot be debugged?

Here is the while select statement.  The breakpoint inside the block doesn't get hit:

pastedimage1580506839845v1.png

The next instruction stopped at is all the way at the end of the while select block, on the last iteration:

pastedimage1580506861013v2.png

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    RE: Cannot debug while select code block in managed code in VS2013

    If you suspect that you have problems with CIL, generating full CIL is good idea. Otherwise you risk wasting time with things that would be solved by CIL compilation.

  • AXGreenHorn Profile Picture
    AXGreenHorn 115 on at
    RE: Cannot debug while select code block in managed code in VS2013

    I tried after doing an incremental CIL, but it still does the same thing.  Do I have to do a full CIL?

    Edit:

    Nevermind, the while select wasn't generating any results.  I don't know why VS jumped to the last line inside the loop, but when I ran interactively in AX, I could see that the while select block was skipped over.

  • Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    RE: Cannot debug while select code block in managed code in VS2013

    Have you updated CIL? Maybe the actually executed CIL doesn't match your X++ code.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans