Category: Windows 8

I had the pleasure to work on one of the apps for the exhibition; Gunnar Ulvaeus’ Scrapbook. Gunnar is Björn’s father and the app is a digitized version of some of the newspaper and magazine clips he kept during the seventies.

The app runs on Surface RT tablets at the exhibition. As with most projects we were on a tight schedule and the first version only scratches the surface (no pun intended :P) of the possibilities of Windows Store Apps.

After the initial release we’ve gotten some feedback and are now working on some changes to improve the app. For instance adding a flip view to make it possible to flip pages by swiping. Once we’re done I’ll get back with some examples on some of the design choices we did.

Meanwhile, get over to the museum and enjoy a piece of music history 😀

A very handy feature of Visual Studio 2012 is debugging on a remote machine.

Especially if you as I develop on a plain old workstation with few or no sensors available. I came across this issue when playing with the orientation sensors. In this tutorial I will walk you through the steps you need to set up remote debugging.

Remote Tools for Visual Studio 2012

You’ll find them on the Visual Studio 2012 download page: http://www.microsoft.com/visualstudio/eng/downloads. Scroll down to Additional Software to find the Remote Tools for Visual Studio 2012. Choose language and version (x86/x64/ARM) and hit download from the computer you want to use as remote machine. Once you have downloaded the package the installation procedure is straight forward.

Configuring the Remote Debugging Monitor

After the installation finishes start the Remote Debugger (you’ll need administrative privileges for the first run). This will bring up the configuration window.

You will also be taken through the procedure for acquiring a Developer Licence exactly like when you created your first Windows Store App project.

If the Windows Web Services API is not installed hit the Install button. Now choose at least one type of network for the remote debugger to communicate on.

Click on Configure remote debugging to start the Remote Debugging Monitor. You should see a message that the Msvsmon is running and awaiting connections.

From the Tools menu choose Options for changing port number, authentication method and maximum idle timeout for the monitor. By default the authentication mode is set to Windows Authentication and the idle timeout is set to 0 (= no timeout).

When using Windows Authentication mode you can set who can connect to the remote debugger from the Permissions dialog.

Setting up Visual Studio 2012

Now go back to your development machine and open up the Properties page for your project and select the Debug tab. In the Debug Start Options section select Remote Machine as target device and click Find to browse for your device. You can also select whether to use authentication or not and if you want to redeploy your app each time you start the debugger. This will allow you to run your app from a clean install each time, but you will loose any app state by doing so.

Taking it for a spin

Now you’re all set for remote debugging on another device. You’ll be able to configure break points and step through your code as if it was running on your local machine.

If you take a peek at the Remote Debugging Monitor on your device you’ll see the connection from your development computer.

Running the Remote Debugger as a service

Normally the Remote Debugger runs as a Windows application but it’s possible to configure it to run a a service instead (as usual you’ll need administrative privileges to set this up). Start the Remote Debugger Configuration Wizard and follow the screens to set it up. This can be advantageous for instance if you want to be able to debug server applications such as an ASP.NET web site without first having to log in to the remote computer.

First select which account will be used to run the service. The account will need “Log on as a service” privileges and network access rights. It’s also advisable to add this account to the Administrators group.

Then configure which networks the service will allow connections from.

Wrapping it up

I hope you’ve enjoyed this short tutorial on remote debugging in Visual Studio 2012. If you liked it or found it helpful – share it with your friends. If something seemed quirky – let me know! You can find some more information about the Visual Studio 2012 Remote Debugger at MSDN.

After too much consideration about the looks and other fluff of On Error Resume Next I’m gonna kick off with a post instead.

One of the things that bugged me while writing DeTV was the lack of tools in the toolbox for creating the charm flyouts for the about and privacy policy pages. So after a quick search I stumbled upon the CharmFlyoutLibrary by John Michael Hauck which did the trick. Still a bit tricky to get working with a gridapps due to the fact that they lack a MainPage.xaml. John Michael of course has an in-depth post about this but I though I’d give it a go with a simple tutorial on how to get CharmFlyoutLibrary up and running with a gridapp.

Grid page with the settings flyout opened

You can get hold of CharmFlyoutLibrary from the Windows Dev Center but I prefer using NuGet. I’ll be building an app from scratch in C# but you can of course follow the steps in your own app. We’ll start by creating a new Windows Store Grid App.

From the Solution Explorer in your new project right click the References folder and pick “Manage NuGet Packages…”

Type CharmFlyout in the search box and hit Install for adding the CharmFlyoutLibrary to your project.

You should see the CharmFlyoutLibrary under References in the Solution Explorer. Now create a User Control to host your flyouts and call it Flyouts.xaml.

You can get rid of the DesignHeightand DesignWidth attributes from the UserControl tag since the dimensions will be controlled by the flyout. Add the CharmFlyoutLibrary namespace to your control by adding the attribute xmlns:cfl="using:CharmFlyoutLibrary" to the UserControl tag. I chose to call it cfl but you can call it whatever you like as long as it doesn’t interfere with any other namespace in your control.

For each flyout you need you create a <cfl:CharmFlyout>...</cfl:CharmFlyout> tag. You need to supply the x:Name and Heading attributes (well, technically the heading is not required but nice to have). The contents of the flyout will be everything wrapped within the StackPanel inside the CharmFlyout.

In the above example I have two flyouts: cflAbout and cflSettings.

Next you’ll need to add the code behind for handling the flyouts.

[sourcecode language=”csharp”]
using System;
using Windows.UI.ApplicationSettings;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;