web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to debug a RunBaseBatch

(0) ShareShare
ReportReport
Posted on by

Hello all,

How to debug a RunBaseBatch ?

I tried to put a breakpoint in its method Run or Main, but it is said "The breakpoint will not currently be hit. No symbols have been loaded for this document"

And when I "Start" debug, and click Ok button, it will just show message "Completed" and never break at my break point.

Thanks,

I have the same question (0)
  • Blue Wang Profile Picture
    on at

    HI WWwong,

    Have you attached batch.exe process?

  • Community Member Profile Picture
    on at

    Hi Blue,

    Should I have to? and how exactly :)

    Thanks,

  • Community Member Profile Picture
    on at

    Hi,

    Ctrl+Alt+P, and find Batch.exe... then Attach ,right ?

    At first I thought if from inside Visual Studio and run Start-Debug, no need. But anyway did that, still no break.

    Thanks

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi WWwong,

    It's under menu Debug - Attach to process. In the opened dialog you also need to mark checkbox "Show processes from all users" if Batch.exe is not visible.

  • Community Member Profile Picture
    on at

    Hi Sergei,

    Yes, did that, but when I run the Action menu which is calling the RunBaseBatch class, it strictly go to end. The "Completed" message is actually right below inside my Main method.

    I've put the break point in many places in that class, in Main method : at <class>.prompt() and <class>.run(). And in  Run method it self, in 2 places inside. but all ignored.

    Thanks

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi WWwong,

    If you run operation wihtout batch processing, you need to use "usual" debugging approach - attach to iisexpress or start debugging from VS.

    If you run operation in batch you need to attach debugger to Batch.exe process.

    If i understood correctly you don't run operation in batch, so you can debug with "usual" path?

  • Community Member Profile Picture
    on at

    Hi Sergei,

    My thought exactly, that;s why at my reply to Blue, I ask should I do the Attach, since I debug from VS. And that's the issue, it's won't break at those break point I already set.

    I just tried again, by the Attached process, and attached "Batch.exe", but still it won't bite. The batch job as I checked in Inquiry - Batch job, has Ended, and no log.

    Please help.

    Thanks,

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    If it says that no symbols have been loaded, the debugger will indeed not hit your breakpoint.

    Please make sure that following settings are in Tools -  Options:

    - Debugging - Symbols: All modules, unless excluded must be checked

    - D365 - Debugging: Load symbols only for items in this solution must be unchecked

    If it still doesn't work, please try to build your model and restart Visual Studio.

    By the way, are you running your code in batch or not? If you don't run it in batch, you need to attach to w3wp.exe / iisexpress.exe. Only if you really run it in batch you need to debug the batch service.

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi WWwong,

    Also, if you run a RunBaseBatch class in batch, only method run is relevant as main and prompt are executed only for user sessions.

    Are you doing the next steps to debug it?

    1. Attach debugger to batch.exe

    2. Open UI and click menu you want to run

    3. In the dialog expand "Run in the background" and mark "Batch processing"

    4. Press "OK"

    5. Wait until breakpoint hit

  • Community Member Profile Picture
    on at

    Hi Sergei.. and Blue

    Apologize, it turns out need to restart, even the VM. Spend more than 2 hours for this :(

    Thanks all,

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans