When I start my site with debug in Visual Studio it will hit breakpoints on the main process, but then when I start a background job with BackgroundJob.Enqueue, none of the breakpoints are hit in that job. How do I debug that job running in the background?
Please be patient, as in default setup with SqlServer, the default interval of polling background jobs is set to 15 seconds. Or you can decrease it as written in the docs. Debugging experience is the same.
The job I was trying to debug’s signature was Task<bool>
and I could not debug it. I changed it to Task and everything worked. Not sure why this was required.
HTH.