You programmed the PIC using the "ICD" Compile/Program button. That's why
it only works with the ICD.

Try using the standard Compile/Program button.