As per Flemming Gregersen's request posting this info
Here is the article to on How to: Debug X++ Code on EP Pages
Make sure you login to the machine in console mode. Also if UAC is enabled, you have to run AX Client with admin privileges (right click and ‘Run as Administrator’) to get the debugger to work. Also note that KB2251040 is required only for WCF debugging, KB962952 is required for EP debugging.