I get this message when I try to attach the debugger to a staging publish in Visual Studio:
As you can see here, it is set to debug mode:
I disabled "Just My Code":
I also tried ticking this box:
I still get the error message. I have tried cleaning and rebuilding.