A while ago as part of my post http://nicksnettravels.builttoroam.com/post/2010/07/24/Howe28099s-my-Windows-Phone-7-application-being-used-Getting-started-with-the-Microsoft-Silverlight-Analytics-Framework-for-Windows-Phone-development.aspxdiscussed how you can enable the console window for the Windows Phone 7 emulator. Since I upgraded my machine to 64bit windows I haven’t got around to enabling the console window but today I decided to give it a shot. Now my previous post stated that you just needed the following registry entry:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftXDE]
"EnableConsole"=dword:00000001
However, this wasn’t working for me…. and actually the XDE key didn’t even exist. Of course, I’m running a 64 bit machine and a lot of the Windows Phone 7 SDK runs in 32 bit mode. Doh! should have realised that of course I’d need to alter the registry key to the following (note the additional Wow6432Node key)
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftXDE]
"EnableConsole"=dword:00000001
Now I can run the console window and write to it using Console.WriteLine (as an alternative to Debug.WriteLine which appears in the Visual Studio debug Output window).
eg Console.WriteLine("Application Loaded");