WEB 304 Building Silverlight Application for Microsoft Dynamics CRM 4.0

This is the second session I delivered in Tech Ed 2009 Australia. It went bloody well I reckon, heaps better than my first session in terms of delivery and time management, and evaluations have rightfully reflected on this as well.

The following is a link the source code I used for this demo.



1. I originally developed this code sample for Business Action Training Tour (BATT) that happened around the world in May/June 2009.

2. This is Silverlight 3.0 code.

3. It uses a charting control from Silverlight 3.0 Control Toolkit, July 2009 version.

4. It will be published on MSDN as a HOL by DPE Corp.

5. As I mentioned earlier, I’m allowed to distribute my Tech Ed decks freely. Sorry about that folk, but you can always email me and ask questions about it. 🙂


DYN330 SharePoint Strategies for Microsoft Dynamics CRM

This is my first session at Tech Ed 2009, Australia. In fact, this is my first time presenting at Tech Ed ever. It was nerve-wracking presenting in front of hundreds of people. Thanks to the folks who came to this session. I got 6 more twitter followers as a result of that!!! I hope you got something out of it, as much as I intended to deliver 🙂

So here is source code that I used in today’s session.



1. This code includes:
    a. Chromeless SharePoint site definition
    b. CRM Workflow for creating the SharePoint site
    c. CRM Plugin assembly that upload CRM email attachment to SharePoint site
    d. Business Data Catalog application definition for CRM
        (This is based on the Analytics Accelerator)

2. The SharePoint site definition was built with WSP Builder v1.0.6, the latest at the time of this post. The CRM solution was built with CRM Developer Toolkit v1.1. You might want to download and install these tools to build the code.

3. Apologies that I can’t provide the slide decks for download as they are only available for Tech Ed 2009 attendees from CommNet.


“The request failed with HTTP status 401: Unauthorized.”

The story:

I needed to do a few demos on Microsoft Dynamics CRM 4.0 for Outlook (On-Premise deployment).

I have this MSCRM VPC VM running locally on my Windows 7 64 bit RC build host machine. This functions as my CRM Server, and I use everything locally to connect to it to do my demos, like; Browse to CRM Web via IE8 on my host, and connect CRM Outlook client to this local VM CRM Server. The reason we are doing it this way, is to hide the VM from the audience all together, so we can show off some of the Windows 7 eye candy features as well. I installed Microsoft Dynamics CRM 4.0 for Outlook and went about configuring it…

The problem:

In the 3rd dialog of the configuration wizard where it asks me for the Intranet address for my crm deployment.


I punched in http://moss:5555/ then click on Next…

(I shared loopback adaptor with my VM and statically assigned IP addresses for both the VM as well as my host on the adaptor, so that they belong the same subnet, I then mapped the IP address to ‘moss’ in the hosts file on my host machine)

This big, fat, ugly error popped out “The request failed with HTTP status 401: Unauthorized.


Wait!!! there is MORE… “Mandatory updates for Microsoft Dynamics CRM could not be applied successfully, Try running the application again.


Ok it and exit out of the configuration wizard…


The Resolution:

So there I was, bing’ing / Google’ing the Interweb in desperate needs for an answer. Thanks to Girish Raja who pointed me to the right directly and here it is:

Microsoft Dynamics CRM 4.0 for Outlook (On-Premise)” doesn’t tell you, doesn’t prompt you, and it secretly, deceitfully uses  ‘Stored Credentials’ on the host machine to connect to the server. If it doesn’t find the login details in the ‘Stored Credentials’ on your Windows OS, it will spit out with the above error messages.

Pretty sneaky I reckon!

So there are a couple of ways you can resolve this,

First approach is to use IE;

1. Hit http://moss:5555/ (Or whatever your crm server address is)


2. You’ll be greeted with a Windows Auth prompt, punch your credential and REMEMBER to tick the "Remember my credentials” checkbox, because this will put your credential in the Windows Vault (a new name in Windows 7 for an old feature Saved Credentials).


3. To see this in Windows Vault (If you are on Windows 7), Start | User Accounts and Family Safety | Credential Manager


alternatively you can directly get to it when in enter “Manage Windows Credentials” or “Windows Vault” and “Stored Credentials” works too…


Second approach is to directly add the credential from Credential Manager, which I won’t elaborate, and I’ll reference to an article on how to achieve this later in this post…

Now, when you go back to the MS CRM Outlook Configuration Wizard; we will be able to step through it…


That was easy 😉

Note: You will not be required to deal with “Stored Credentials” if you satisfy the following conditions;
a. Your machine is joined to the same domain as MSCRM
b. You’ve logged on as a domain account and your domain account is a CRM User.
d. You’ve added MSCRM URL to your Intranet sites.
e. Your IE settings is set to “Automatic logon only in Intranet zone” in IE 8 | Tools | Internet Options | Security | Local intranet | Custom Level | User Authentication | Logon


A side note on Windows Vault in Windows 7:

It seems to me that, Windows Vault is essentially the “Stored Credentials” or “Stored User Names and Passwords” feature in previous Windows OS (client and server) but given a prettier name in Windows 7 and with more features.

My colleague Chaks has written a great article explaining the Windows Vault  feature in details.

Virtual PC Management for MS CRM Consultants

The Blab:

I don’t particularly enjoy being deprived of sleep, and things like attending a live LiveMeeting session running 9:00AM – 10:00AM on Pacific Time (meaning waking up  at 3:00AM on our NZ Time) doesn’t really appeal to me a great deal.


– Long live LiveMeeting On-Demand!!! 🙂

So, I was watching a MSFT Partner on-demand LiveMeeting training “Launching Your Microsoft Dynamics™ CRM Practice: Tools for Microsoft Dynamics™ CRM Consultants” hosted by Val Draper, a CRM PTS out from the States somewhere.

Ok, getting to my point of this post. There was a few polling questions Val started his session on, one was “Do you use Differencing disks on the Microsoft Dynamics CRM VPC image”. I was in complete AWE when I heard what the response was – “100% of the attendants are NOT using differencing disks” and these are MSFT Gold partners around the globe we are talking about here…

In this post, I write about what differencing disks are, why I use differencing disks and how I use it with Microsoft Dynamics CRM VPC Image.

Issue #1: “I need more disk space for my VPCs!!!”

I’m a MSCRM Specialist and I work with different clients on their MSCRM implementations day in and day out. Just like most(?) other MSCRM Specialists out there, I do ANYTHING and EVERYTHING in the Microsoft Dynamics CRM VPC Image. If it had a 2 bedrooms apartment with a heat pump and a sea view, I’d live in it.

The two OOTB .VHD files come with this VPC image are 15.6 GB in size. Imagine I get pimped out to work on 15+ clients’ implementations over a course of 6 months time (which is insanely realistic). To keep different clients IP (customisations, codes, third party add-ons etc) separate from each other, I’ll need to have 15 copies of the VPC image on my laptop.

So Let me pull up the calculator: 15.6 GB x 15 = 234 GB and let’s assume client specific changes we make are 3GB each 3GB x 15 = 45GB. All up I need 234GB + 45GB = 279GB of disk space just for my VPC storage.

Soon I’ll be crying out loud for more disk space… 


Introducing Microsoft Virtual PC Differencing Disks

This is a really simple concept, a differencing disk is simply a VHD file that’s created based on another VHD file. Let’s call this base VHD “Parent VHD” and the differencing disk “Child VHD” for the moment and they work like this,

1. A “Child VHD” can be created with Virtual Disk Wizard in Microsoft Virtual PC using “mouse-point-and-click”, the “Child VHD” keeps a reference to “Parent VHD”.

2. When we create a Virtual Machine using Microsoft VPC, we can directly point the VM to the “Child VHD”. So in the VMC file there is no reference to the “Parent VHD”.

3. When we commit “Saved states” (a.k.a. any changes we made to a VM) to Hard Disk, it is saved to the “Child VHD” instead of “Parent VHD”. We essentially write all the differences we made to the Child VHD, hence the name “differencing disk”.

4. “Parent VHD” file can be and should be permanently marked “Read Only” via file properties at OS level. (explained further down this post)

How is differencing disk helping us with VPC disk spaces?

In our context, the “Parent VHD” is the “CRM-SRV-01 2009.vhd” that comes Microsoft Dynamics CRM VPC Image, and I create a child VHD for each of the 15 clients I have. Since we are not writing our changes to the “Parent VHD”, it remains client independent. Therefore, we can share this parent VHD across all of our clients, and assuming that our client “Child VHD” are 3 GB on average as well. Which means I only need 3GB x 15 + 15.6GB x (15 – 14) = 60.6GB of disk space comparing to 279 GB. This is a total saving of 279GB – 60.6GB = 218.4GB and 78.3% (218.4/ 279) of disk space comparing the the previous approach.


“So, how exactly do I create a Differencing Disk for MS CRM VPC Image” – I hear you ask?

Here is a step to step instructions on the HOW-TO…

  1. Download Microsoft Dynamics CRM 4.0 Virtual PC Image (April 2009).
    (*Note: you will need to have MBS Partner access, this image expires on 12/08/2010)image
  2. Double click on “MSCRM 40 2009 Demonstration VPC.part01.exe” to extract its content. When the extraction completes, you will see three files.image 
    “CRM-SRV-01 2009.vmc” – Fist thing to do is to delete this file, because, this is the VM that directly references the “Parent VHD” (CRM-SRV-012009.vhd). This is not what we want. What we want is to create a “Child VHD” (Differencing Disk) that reference this “Parent VHD”, THEN, create a VM (a vmc file) based on the “Child VHD”.

    “CRM-SRV-012009.vhd” – This is our main guy, it contains the Operating System, all software installed etc. This will be the “Parent VHD” for our clients Differencing Disks. You notice that I’ve made this file read only. This is because if I make changes to this file after creating Differencing Disks based on it, the Differencing Disks will become invalid.

    ”CRM-SRV-01 2009 Extrax v1.vhd” – This vhd contains a whole bunch of additional utilities like the accelerators etc. When mounted to a VM, this shows as a separate drive.

  3. Open Microsoft Virtual PC 2007 SP1.

  4. File | Virtual Disk Wizard
  5. Next | Select “Create a new virtual disk” | Next | Select to create “A virtual hard disk” | NextimageHere are a few rationales that I chose the above location for this differencing disk; 
            a. I store all my client project work under %Drive%:\Projects\ 
            b. I name the folder the client’s name – in this case, I have “Client 15” 
            c. I explicitly name the differencing disk “client name” + Diff
    , so that even if it does get out of the folder context I know
               exactly what it is for. I sometime add the “project name” to it too 
               if there are more than one crm project going on with one particular
           d. The reason I don’t include the “Parent VHD” name in this diff name is 
               because, when I do get to created a new VM based on this Diff Disk, 
               and it loses its references to the “Parent VHD”, it will show me the
               Parent VHD’s name and ask me to link to it.
  6. Next | select “Differencing” | Nextimage
  7. Browse to the “CRM-SRV-01 2009.vhd” file that we extracted earlier.imageNote: It warms us that we shouldn’t do any changes to this parent vhd. This 
             is why I made it read only in step 2.
  8. Finish | Congratulations!!! You have now successfully created a Differencing Disk based on the Microsoft Dynamics CRM VPC Image.image
  9. Now we will create a Virtual Machine based on this Differencing Disk.
    File | New Virtual Machine Wizard.

10. Next | select “Create a virtual machine” | Nextimage 11. Browse to a location and enter the name for the vm | Nextimage      Note: I personally prefer to store the vmc files alongside referenced vhd file. 
               In this case, it’s %Drive%”:\Projects\Client 15\Client 15.vmc

12. Select Windows Server 2003 for OS as is the Microsoft Dynamics CRM 4.0
      Virtual PC Image (April 2009)
| Next.image

13. Allocate 2GB of memory to the VM | Nextimage

14.  Select “An existing virtual hard disk” | Nextimage
15. Select the vhd file location, check Enable undo disks | Next.image     Note: This is the differencing disk we created earlier, the “Child VHD”. 
              I always check Enable undo disks, I think it should default to checked.

16.  Finish | Woila!!! You have successfully create a Virtual Machine that’s based 
       a differencing disk! and you can go about using the newly created VM.image

Issue #2: “My VM is running too slow, how can I improve its performance?”

One other benefit of using difference disks, apart from saving disk space, is it can greatly improve your VM performance by running the Base (parent) VHD on a separate physical disk (not just separate disk partitions), yet better, run it on a USB stick or a separate Solid State Drive (SSD). Here are the reasons;

1. By creating a differencing disk, we are introducing an additional file for Virtual
    PC Process to perform Disk Operations on. This is on top of the Parent VHD
    and the saved states files. So, having the Parent VHD separate from the
    Differencing Disk and saved states files on a different physical disk, we are
    offloading competing Disk Operations on one single disk.

2. This Parent VHD is read only and we are only doing ONLY Read Disk Operation
    on it, SSDs and USB drives are fantastic in performing read disk operations.
    (and shit in doing writes). So the set up is illustrated in the diagram below;


3. Taking this setup one step further, I have these 32GB USB drives, I put two
    different Parents.vhd files on them, create two diff disks and two VMs pointing
    to each of them respectively, give them 1.5 GB of RAM each, leaving 1GB of my
    Windows 7 64 bit host OS. AND run two VMs on one single laptop!!! It works
    like a charm!!!IMG_0245 If you are really up to it and have these 8GB onboard RAM laptops lying around, you can try to run 3 VMs at the same time, give them 2GB each and see how they go 🙂


1. As a CRM Specialist, we have multiple VMs catering for different clients. 
    Differencing Disk is a very space efficient approach to manage these VMs.

2. You can host the base Microsoft Dynamics CRM VPC VHD on a USB drive for 
    your VMs to improve their performance.

3. You can take this concept one step further and run two VMs (perhaps more if 
    you have one of those 8GB RAM laptops) at the same time without taking much 
    toll on the performance.

4. These concepts don’t just apply to CRM  peeps, it really applies to anyone that
    use multiple VMs, check out Andrew Connell, a SharePoint MVP, a virtualization
    maniac, how he has taken SharePoint development VMs to the extreme.

Happy VM’ing everyone!!!

I’m taking BATT to China


If you don’t know what BATT is, read this earlier post. Over the past week and a bit I’ve been busy localizing some of the training material for our Chinese audience and I’ll be taking it to China for my follow countrymen and women later this month (June 2009)

This training tour is a two full day training course that focuses on building Line of Business applications with Microsoft Dynamics CRM 4.0. There are 6 modules;

1. Using Microsoft Dynamics CRM 4.0 with Windows Presentation Foundation
2. Using Microsoft Dynamics CRM 4.0 with Silverlight
3. Microsoft Office Client Integration with Microsoft Dynamics CRM 4.0
4. Using Microsoft Dynamics CRM 4.0 with Unified Communication
5. Introduction to Azure Services Platform with Microsoft Dynamics CRM 4.0
6. Microsoft Dynamics CRM 4.0 with Windows Azure

Each module consist of one hour of ppt and demos, followed by another hour of 300 level deep code dive hands on labs.


Date & Time: 24th & 25th June 2009, Start from 9:00am each day
日期和时间:2009年6月24,25号。 每天早上9点开始。

Location:  7th Floor, Tianjun International, No.365 Tianhe Road, Guangzhou, China
地址: 广州市天河区天河路365号天俊国际大厦七楼

Cost: FREE!!!  免费!!!


There are VERY limited spaces available as this will be the ONLY BATT course for the ENTIRE China, a country with 1.6 billion population (yeah, go figure.)

So, to register email Liping on v-lipz@microsoft.com with your details!

See you all there!!! (Oh, it will be delivered in Mandarin Chinese BTW 😉

So I’ll be hitting the road again 22nd – 28th June WLG – AKL – HKG – CAN – TAO – HKG – CHC – WLG (looking forwards to seeing my folks again @TAO) 🙂

No Triple monitors for me :-(

Dell Precision M6300

So I finally hunted down a second external (third overall with my laptop) LCD monitor (very difficult to come by at work if you are already on two) with the full expectation of being able to run my ship like Captain Kirk with three monitors.

My pathetic little NIVDIA Quadro FX 1600M only fricken supports up to two displays and I am on Windows 7 RC 😦




My Captain Kirk dream is still on hold 😦

What a let down!!!


More Business Actions


This is way more exciting than Business Time by Flight of the Conchords (okay, maybe that’s debatable). If you missed out on the Business Action World Tour that happened in in March all around the world in person. Never fear!!! Here is another chance. The same sessions will be delivered via Livemeeting across three different time zones from Monday 27th April to Friday the first of May.

For content details and registrations visit Ben Riga’s post or Catherine Eibner’s post.



This is the next wave of Worldwide Business Action on Microsoft Dynamics CRM by Microsoft Metro program. It’s a two-day Instructor Led Training (ILT) course and my colleague Chris Auld is instructing this course in Singapore on 10th-11th May and Sydney on 14th-15th.

Back in February, a team of us at Intergen worked very hard and built the content for this training course – six modules; a mix of presentation decks, demonstrations and hands-on labs for this training course. The labs are step by step instructions on how to build Line of Business applications by leveraging the greatness of Microsoft Dynamics CRM as an application platform and integrate with WPF, Silverlight, OBAs, OCS, .NET Service and Windows Azure.

For registrations refer to blog posts from Chris or Catherine.