Friday, 23 September 2011

Windows 8: How to setup Remote Debugging on Windows 8 using Visual Studio Express

Windows 8 is great and I have been having a lot of fun learning it and getting ready to develop Metro Applications. One of the first things I do when learning a new systems is to get to know my tools and how to configure them. One of the first things I wanted to know was "How do I setup Remote Debugging on Windows 8 using Visual Studio 2011 Express?"

NOTE:
  • The below steps are based on a Windows 8 Developer Preview with Tools machine to a Windows 8 Developer Preview with Tools machine. Luckily this seems to just work. I have included a few links on the bottom of this post to help you if you have problems.
  • Remote Debugging is installed on the Windows 8 Developer Preview Install so all you have to do is turn it on. The steps below will help you to do this.
On the Remote Machine that I want to run my debug applications on remotely I log in and start to configure remote debugging. I am configuring it so that my development machine can send remote debugging request to it. This includes Metro applications where your program is packaged up and remotely installed on this machine to run and be debugged by the development machine. Below are the required steps:
  • From the Start menu you need to click on the "Remote Debugger" panel show below surrounded in red.
  • For those of you that just need to know where the program is you can see the full path to it in the below screen shot.
  • After clicking on the "Remote Debugger" Panel you will be taken to the Windows desktop where the Visual Studio Remote Debugger is running.

On the development machine where I will be writing code and hitting F5 to run my code on the remote machine I will also need to do some configuration. Below are the required steps:
  • Load Visual Studio and the Solution that you be remote debugging.
  • Click the little down arrow next to the usual green start your project arrow as shown below
  • Select Remote Machine as Shown
  • Next you will need to update the Projects Debugging properties as shown below
  • Update the Machine Name to match the name of the machine that you configured for Remote Debugging in the earlier steps. I have put a red box around the exact place that will need to be updated.
You are now ready to start remote debugging!

Below are a few opportunities I encountered because I setup remote debugging on a fresh machine where I had not yet accepted the Metro licensing agreement.

After hitting F5 or clicking on the green start arrow from the Development Machine I was quickly prompted with the below dialog.


The dialog told me to check the console of the Remote machine that I am trying to run my program on. I quickly went to what I am calling the Remote Machine and noticed this prompt.


From the Remote Machine console I clicked on the "I Agree" button, then went back to the Development Machine and Clicked "OK" on the "Developer License Acquisition" dialog.

Visual Studio then continued to load and I was greeted with the program running on the Remote Machine as shown in the below screen shot


When I was done debugging on the Development Machine I ended the remote debug session by clicking on the Stop debugging button or by hitting "Shift+F5".

On the Remote Machine Console I can see that the program has stopped running there and all I have left is my Remote Debugging Monitor as show below


You can safely close this dialog by clicking on the red "x" above as usual. After doing this you will get a nice task tray notification letting you know that the Remote Debugger in still running as show below

Some Warnings:
  • Be sure to have the Remote Machine logged in and showing either the Start Panel or the Windows Desktop. You will get an error if you are not logged in.
  • As I eluded to earlier, the Metro program you are debugging is actually installed on the Remote Machine. You can see this in the screen shot below. I have placed a red box around the newly installed program to identify it for you


Below are a few links to sites that are related to this topic:

No comments:

Post a Comment