Hi,
How do you power your circuit?
Depending on how the command line switches are set it may be that the commaŽnd line interface is set to provide power to your circuit while, when you you're programming from within MPLAB, thePICKit3 is not set to provide Power to the circuit.

/Henrik.