You cannot debug Background task agents the same way you debug normal windows phone projects. Here are some techniques used.
http://developer.nokia.com/community/wiki/Background_Agents_Debugging_Tips_on_Windows_Phone
I have used the ShellToast successfully to debug my agents. IMPORTANT: Remember to remove/comment all those code you add before deploying, or use #IFDEF statements.