In Dynamics NAV 2017 we got the new Task Scheduler to replace NAS.
But Task Scheduler don’t use a normal session for execution, so it does show up in the Session List. So how do you debug a running session from Task Scheduler.
Put a breakpoint in your Codeunit.
Open Debug Session as normal, and click the Debug Next button, and wait until it fires.