8.1.2 Debug Failure Errors
The target device is not ready for debugging. Please check your Configuration bit settings and program the device before proceeding.
You will receive this message if you try to Run before programming your device. If you receive this message after trying to Run, or immediately after programming your device:
The device is code protected.
The device on which you are attempting to operate (read, program, blank check, or verify) is code protected, that is, the code cannot be read or modified. Check your Configuration bits setting for code protection (Windows > Target Memory Views > Configuration Bits).
Disable code protection, set or clear the appropriate Configuration bits in code or in the Configuration Bits window according to the device data sheet. Then erase and reprogram the entire device.
If these actions fail to fix the problem, see Debugger to Target Communication Error Actions and Debug Failure Actions.