IntelliTrace vs. PreEmptive Analytics

Submitted by Robert MacLean on Fri, 03/30/2012 - 14:19


Visual Studio 2010 introduced an amazing feature: IntelliTrace which allows for deep debugging experiences inside Visual Studio by collecting an AMAZING amount of information (basically a stack trace for every call in your code + meta data) and allowing you to use it later to replay the way the application was used. With this feature you could eliminate those “No Repro” bugs! The catch in 2010 was it was NOT allowed to be used in production. In Visual Studio 11 that has changed and we can use it in production: &

PreEmptive Analytics

This change in licensing may seem to put IntelliTrace in direct competition with another great tool, PreEmptive Analytics (PA). I have mentioned this amazing tool before and with Visual Studio 11 it is included “in the box” so there seems to be a conflict brewing – but there isn’t.

Two sides of the same coin

These two tools are both part of the collect information so you can react to it later and fix bugs set of tools, but they have very different use cases. IntelliTrace is specific to the scenario of replaying an application for diagnosis and debugging purposes. It is not meant to be an always on tool and it is a tool that writes to a local file that needs to be collected some how.

PA on the other hand is a tool to always have on, it does capture error information but nothing more than the simple Exception + Stack which is not as useful, detailed or integrated into VS when compared to IntelliTrace. In addition PA allows me to do a lot of a lot of analytics on my application that are not possible in IntelliTrace:

  • what features are people using
  • where in the world are they
  • when are they using it
  • what are their machines like

In addition the PA reports get automatically sent to a server (that they run or that you can run if you have privacy/security concerns) so there is not need to waddle around collecting files.

I can also see scenarios that these two work hand in hand – PreEmptive getting higher level info that shows a lot of users having issue X, then the support guys contact some users and do a more detailed capture of the issue with IntelliTrace.

Installing Windows Phone Developer Tools on Windows 8

The joys of being on the bleeding edge, is we are sometimes bleeding such as the fact the Windows Phone Developer tools have not worked on Windows 8… until now. However the steps to do get this working are not easy and are spread out a bit on the Internet, so this post aims to give you a one stop, quick reference way on how to get it done in five steps.

Step 1 – Get the bits

You will need THREE downloads for this:

  1. The Games for Windows Marketplace Client:
  2. The Windows Phone SDK 7.1:

    personally I would get the ISO for it from:

  3. The Windows Phone SDK 7.1.1 Update:

This should set you back 1.1Gb in bandwidth.

Step 2 – Install the Games for Windows Marketplace Client


Troubleshooting notes:

Step 3 – Install .NET Framework 3.5

Now pop in your Windows 8 DVD (or mount the ISO), next open a command prompt AS ADMINISTRATOR and navigate to the \sources\sxs folder on the DVD and run the following command. My DVD was mounted on drive F so note you may need to change the underlined part of the command to match your situation: dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:f:\sources\sxs /LimitAccess


Step 4 – Install Windows Phone SDK 7.1

Now run the installer for the Windows Phone SDK 7.1 as per normal.


Troubleshooting notes:

  • If you get any errors about installing some components, try to copy them from the disk to the desktop – if you get a invalid MS-DOS function error, then you have a corrupt ISO and need to download it all again.

Step 5 – Install Windows Phone SDK update

Almost there, just the Phone SDK update to install!



And there we are, the tiles are on the start screen, Visual Studio 2010 launches (and hurts my eyes with all those colours :P ), the new emulator options are all there in the drop downs and the EMULATOR WORKS!!!!


Troubleshooting notes:

  • If you have a CPU that supports SLAT (for example a Core i7) you can run Hyper-V on Windows 8, which hurts emulator performance. Turn if off it you can.
Robert MacLean Tue, 03/27/2012 - 16:18

Upgrading Visual Studio "11" Developer Preview Metro Projects to Visual Studio "11" Beta Metro Projects

Submitted by Robert MacLean on Thu, 03/01/2012 - 03:14

76451If you created Metro style (WinRT) projects in Visual Studio “11” developer preview (alpha) and you try to open them up in the beta you will have a few load issues. These are ones I have found in my apps so it is not exhaustive, but seems like the most common.

Projects will not load

The projects themselves will not load with the following error: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v1.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. 

The solution to this is to open the project file and navigate to the <Import> node and change the path from v1.0 to v11.0 (see the highlighted extra 1 in the image below that is needed):


Compiler Directive

If you used the compiler directive WINRT that has been changed to NETFX_CORE so you will need to update your code.

Package fails to build

The package fails to build/deploy and complains about an InitialRotationPreference attribute. To solve this open the Package.appxmanifest file and find the <VisualElements> node and you should find an line similar to this:

<VisualElements DisplayName="AtomicMVVM Metro Style App Demo" Logo="Images\Logo.png" SmallLogo="Images\SmallLogo.png" Description="AtomicMVVM Metro Style App Demo" ForegroundText="light" BackgroundColor="#000000" InitialRotationPreference="portrait">

What you need to do is remove the InitialRotationPreference attribute from the end, so it ends like this:

<VisualElements DisplayName="AtomicMVVM Metro Style App Demo" Logo="Images\Logo.png" SmallLogo="Images\SmallLogo.png" Description="AtomicMVVM Metro Style App Demo" ForegroundText="light" BackgroundColor="#000000">

Big load failure image from:

Important changes to Express Editions of Visual Studio "11"

Submitted by Robert MacLean on Wed, 02/29/2012 - 19:34

manualtrafficexchangetipNote: The source of this is the Visual Studio “11” beta Product Guide ( so this may change by release.

Today we have five Express products: C++, C#, Visual Basic, Web and Phone however with the launch of Visual Studio “11” we will only have TWO!

These two editions of Express we will have are Web & Windows. I do not believe we will only ever have two editions, as the 2010 Express editions grew during the product so I would expect a few new ones coming along post launch.

So how does the old Express editions map to the new Express editions?

  • C++ maps to NOTHING
  • C# for WinForm/WPF/Silverlight maps to NOTHING
  • VB for WinForm/WPF/Silverlight maps to NOTHING
  • Phone maps to NOTHING
  • Web maps to Web

Let me reiterate this, if you want to build non-Metro applications (unless they are web) there is NO Express edition anymore for this! The Windows Express edition ONLY allows the building of Metro apps (including ARM). Web dev using Express editions still continue to work as before.

Both Express editions have a new enhancements too, which is a fantastic thing: The ability Version Control & Work Item Tracking with TFS is included out of the box.

For the Windows express edition it has even more enhancements

  • A subset of static analysis (fxCop) for helping developers pass Win Store evaluation
  • Performance Profiling has been added: CPU Sampling for C#/VB/C++ Metro apps and Instrumentation for HTML/JS Metro Apps

Stop/Important image from

Charting with Lightswitch

Submitted by Robert MacLean on Fri, 02/24/2012 - 14:04

One of the key business aspects not included with Lightswitch 2011 is a great set of charting controls and often I need to have a few for the projects I am working on. Thankfully with the Silverlight Toolkit and a touch of code I can have BRILLIANT charts for no extra costs!

Below are three charts using the Silverlight Toolkit in Lightswitch, which I think look FANTASTIC and it is fairly easy to do in four easy to follow stages.

imageimage image

For this tutorial I have a simple structure of engine parts, costs over time and purchases which looks a little like the image below and for I have already created the data structure and UI for adding those in Lightswitch.


Stage 1: Get the toolkit

To start off we need to switch out of the Logical View and into the Files View, to do this in Solution Explorer click the “Lie to me button” (that is what I call it) and change the view.


Next right click on the client project and select Manage Nuget Packages. If you do not have Nuget yet, stop, download Nuget from and install it and come back.


In Nuget search for the silverlight toolkit and install the Data Visualization package. Now unfortunately Lightswitch isn’t too good with Nuget, so really we are using this as a way to get the packages but they are not properly installed as you may expect.


Stage 2: Create the screen and add the control

Now switch back to the Logical view and add a new Editable Grid Screen, give it a nice name but do not select any Screen Data.


In your new screen, click the add button at the bottom and select New Custom Control. If you do not have that, you have selected the add option for the Screen Command Bar, so make sure the Rows Layout at the top is selected.


Now we need to add the assemblies for the Silverlight Toolkit packages, to do this press the Add Reference button in the Add custom control screen.


Browse to the packages folder in the root of the Lightswitch project and add the two assemblies. Once done browse the System.Windows.Controls.DataVisualization.Toolkit assembly and go to System.Windows.Controls.DataVisualization.Charting.Chart class and select OK.


Stage 3: Configure the chart control in Lightswitch

The control should now be listed. Next go to the properties and give the chart a name, this is important so name it something you will remember.


Now we change the sizing of the chart control to be Stretch for both Horizontal and Vertical Alignment. This allows the chart to use all the space on the screen!


Stage 4: Add some code to get the data and put it in the chart

Now we need to add the code to get the data and render the chart. We do this in the Created event for the screen (to get there, click the Write Code button in the toolbar and select the event).


Now we add some code to the event, which does:

  1. Find the chart control.
  2. Get the data from the DataWorkspace into a list.
  3. Set chart to use the data.
partial void CostOverTimeChart_Created()
    // Write your code here.
    var chart = this.FindControl("chart");
    chart.ControlAvailable += (s, e) =>
        this.Details.Dispatcher.BeginInvoke(() =>
            var dataPoints = (from Costs c in this.DataWorkspace.ApplicationData.CostsSet
                              group c by c.EnginePart).ToList();

            var chartControl = e.Control as Chart;
            chartControl.Dispatcher.BeginInvoke(() =>
                foreach (var group in dataPoints)
                    chartControl.Series.Add(new LineSeries()

                        Title = group.Key,
                        IndependentValuePath = "PointInTime",
                        DependentValuePath = "Cost",
                        ItemsSource = group

If we dive into the code:

  • Line 4: We use the FindControl method with the magic string we named the chart to find the control that wraps the chart.
  • Line 5: We attach to the event for when the chart is available.
  • Line 7: We use the dispatcher for the screen to run a call to the DataWorkspace to get the data and put it into a list. We need to dispatch this as the DataWorkspace is in a separate thread.
  • Line 12: We get the actual chart control now from the event arguments.
  • Line 13: To set the values on the control we use the charts dispatcher as it is separately threaded.
  • Line 15: We clear any existing  series and then add new series. This code is nothing special to Lightswitch, this is just normal Silverlight charting.
  • Wrap up

    It seems like a lot to do this, and it is. You could make this easier by wrapping this in a custom Lightswitch control which would give you GREAT reuse, but that is a lot of work too. In the long run if you use lots of charts you will save time by building the custom control – but if you need just one or two this is a little quicker and less learning.

    Below you will find a link to the sample product I used to create all the charts and it has all the code in it too, if you are looking for it. Make sure you have Nuget installed before you use it!

    VS/TFS 11 Announcement Crib Notes

    1680.SolutionExplorer-2The last few hours have been a buzz of excitement for .NET developers as the covers have been lifted for the next releases of TFS, VS & .NET 4.5 – however there is a problem. There is SO much info wrapped in nice marketing & business talk you will spend hours trying to get through it all, so here are the crib notes. Following each note is a number in braces, this is the number of the source so you can go to it for more info if you wish:

    • .NET 4.5, VS 11 & TFS 11 beta’s will be available on the 29th Feb. [1]
    • You can use the products in production from beta (technically called a go-live licence) [2]
    • Visual Studio 11 has had a UI polish, similar layout but less toolbars by default, less colours (icons are monotone) & a touch of Metro like thinking (white space & typography) [2]
    • Five editions (or SKUs) of Visual Studio will ship: Express, Test Pro, Pro, Premium & Ultimate. Same as we have in 2010. [3]
    • TFS will have at least two editions, Express (think TFS basic but FREE) and another edition. We may have more than that. [8]
    • Visual Studio Professional and up will include Lightswitch! [3]
    • The architecture tool diagrams can now be read in professional & premium versions too (in 2010 it was premium only). Creation still requires ultimate. [4]
    • IntelliTrace is supported in production (still an ultimate only feature). [4]
    • Windows Phone 7 tools included with professional and higher editions of Visual Studio 11. [4]
    • Express will have two versions: Windows (WPF, WinRT, etc..) & Web (ASP.NET, MVC etc…). [5]
    • There are two themes for Visual Studio: Light (pictured above) & Dark which feels like a Expression Blend style. [6]
    • Quick launch is a new search feature allows you to search for any command or option in Visual Studio. [6]
    • Search has been added to most used tool windows, like solution explorer. [6]
    • ASP.NET MVC 4 has a bunch of evolutionary improvements, nothing to wet your pants on IMHO. [7]
    • ASP.NET Web API is a big new feature for both MVC & WebForms for building API’s for the web. Think services like WCF but built for the modern web. [9]
    • Visual Studio 11 is a code name – expect a name change by release. [10]
    • Workflow hubs in Visual Studio 11 allows you to focus on a task in a single place, rather than have to move around multiple windows. [11]
    • Preview tabs allow you to sneak a peek at documents without needing to actually open them. [10]
    • C# 5 (yes, it is version 5 of C# that is shipping with .NET 4.5 – who says this is confusing) has support for async. [10]
    • New code compare tool & UI that doesn’t suck. [11]
    • New code review tool support in TFS & Visual Studio. [12]
    • New mock up design tool that ships with Visual Studio/TFS that allows you to build mock user interfaces in Powerpoint. Think Sketchflow without the code or Balsamiq. [13]
    • New Visual Studio METRO’d logo [14]: VS11-Beta_h_c

    Want to see some pictures of all of this?



    Robert MacLean Fri, 02/24/2012 - 09:00

    Presentation Dump - End 2011: Azure, Windows 8, Lightswitch, Visual Studio Tools, TFS & Roslyn

    Submitted by Robert MacLean on Wed, 01/04/2012 - 08:54

    With 2011 finally done and dusted it is time for the bi-annual presentation dump, where I upload most of the slides I have done in the last six months to share with you! I say most, as some presentations are NDA and those, unfortunately, I can’t share out – but where I can upload slides I do!

    In this presentation dump we have:

    • Windows Azure Platform Overview: This is a talk I gave at the ImagineCup to faculty members about what Microsoft Azure can offer!
    • Windows 8: A brief introduction shortly after the //Build conference to help share what information we had on Windows 8
    • Lightswitch: The latest iteration of my Lightswitch talk contains a structure overview before the demo and then goes into detail on the themes and extension model in the product.
    • Developer Productivity Tools: A session that looks at FIVE FREE tools for Visual Studio that will assist in the productivity of any Microsoft .NET developer in Visual Studio. Tools covered are fxCop, StyleCop, Pro Power Tools, CodeRush Xpress & Nuget.
    • An Introduction to TFS: The target audience for this is someone or company who is using another source control (like VSS) and is thinking about moving to TFS but isn’t sure where to start. This BRIEF introduction tries to provide a high level view that TFS is not just source control it is a LOT of more and thus has a lot more power. It also mentions migration from VSS and provides guidance for success.
    • Roslyn: This is an early look at Roslyn

    It is definitely a quieter period than most, in terms of number of unique slide shows and I think a lot of that comes out of the information black out from Microsoft prior to //Build, but it was still a very period with me presenting Lightswitch NUMEROUS times and also Tech·Ed Africa where I did four presentations!

    You can get all the slides and details by clicking “read more” below!

    Windows Azure Platform Overview

    Windows 8


    Developer Productivity Tools

    An Introduction To TFS


    MVP for a third time :)

    Submitted by Robert MacLean on Tue, 01/03/2012 - 09:30


    364 days ago & 829 days ago, I blogged about being awarded a MVP from Microsoft and I am proud to announce that I have been awarded a MVP for a THIRD time!

    Thank you to all that were part of making this happen, I am very honoured by all of you.

    What is an MVP? In short it is a thank you for helping Microsoft communities. The long version can be found here.

    The Arturo Grid for Windows Phone 7 in PNG & GIMP

    Submitted by Robert MacLean on Wed, 10/26/2011 - 07:38

    layoutArturo Toledo works at Microsoft on the Windows Phone Design Studio team, and last week I had the chance to attend phone training with him. In that training he showed a grid he used for layout so that his apps match the layout of Windows Phone 7 apps – I call this the Arturo Grid.

    Yesterday he posted about it and released an Expression Design version of it, which is great if you have Expression Design… but if you don’t it can be a problem. So I recreated it using the free graphics tool, The GIMP, and produced a transparent PNG version so that it can work in just about anything!


    How I did it?

    GIMP is a fantastic tool and I thought I would share how I created this layout. First I started with a new image, with the resolution of 480 x 800 and a transparent background.


    Next run FiltersRenderPatternGrid and set the parameters as in the screen shot below. Note the offset horizontal & vertical lines are not linked. What we are doing here are creating grids of 37x37 (25 + 12 based off the Arturo Grid) with line width of 12 (so the space that is left is 25x25). The offset is +6 so that it pushes out, because the line widths are based on the middle of the line and not the edge.


    Now add two layers, another transparent one and a white backed layer.


    Place the new transparent at the bottom and the white in second place.


    and now merge down the grid layer onto the white layer.


    Now drag on guides:

    • Vertical: 24px
    • Vertical: 456px
    • Horizontal: 56px
    • Horizontal: 784px

    and select that region.


    Create a new

    Then use Select ► Invert and press delete. This removes the area around the grid for the bleed (padding) area that your app shouldn’t use.


    Now use the Fuzzy Select Tool (aka the magic wand selector tool) and click on the black.


    Now hit delete to remove those black lines leaving just the white squares.


    You can tweak the colours using the colour exchange tool (Colors ► Map Color ► Exchange) and you can tweak the transparency using the Opacity option on the layer tool to make it more transparent.


    There you go, now you are done Smile


    Tech·Ed Africa: Slides, Scripts & Thoughts

    Submitted by Robert MacLean on Wed, 10/19/2011 - 10:46

    WP_000405WOW! I am sitting here under s a fake tree in a fake city that is Micropolis (also known as the Tech·Ed Africa 2011 expo, and it is AMAZING!). I have just finished my third and final presentation at Tech·Ed Africa 2011 and I just wanted to say THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU to all the people who attended my talks!

    This year not only has an amazing expo, but the audiences have been by far the BEST EVER! A special thanks to those who braved 8am to see my .NET 4 talk – 2min before I started I thought “I need sleep”, 2min after the energy from the audience was flowing and I never looked back at what I felt was a great talk, so thank you! Smile

    what it looks like from the presenter at #techedafricaA special work of thanks to Suliman and DPE (it is their fake tree I am sitting under) for arranging this and the opportunity to present! I also want to say thanks to the technical team at the event, without who you would not see or hear me, and they were fantastic this year!

    For those who attended my talks, or those who couldn’t below are the slides, scripts and misc files used in the talks!

    (for those in an RSS reader or on the home page, click read more)

    Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

    File downloads

    Extend Visual Studio 2010

    File downloads

    Building Business Applications with Microsoft Visual Studio LightSwitch

    File downloads