Recently I was having problems exporting a solution from an on-premise CRM 2013 organisation. Unusually there was no additional log to download and turning on verbose logging allowed me to see the exception being thrown on export but there was no indication to the source of the error.

I eventually resolved the problem by process of elimination, removing likely candidates from the solution until I could export successfully. It turned out to be an errant Routing Rule Set which was configured for forwarding to a queue but the queue wasn’t defined. Since you can’t create a rule and forward to a queue without defining the queue, I assume it must be due to the solution having originally been imported unmanaged and the queue name defined in the Rule Set not existing on import.

I was struggling with this error recently whilst trying to import a managed solution into a CRM 2013 SP1 integration environment. It turns out that the form that it was telling me didn’t exist was a Quick Form that did!

Having confirmed the form existed in the org and solution I exported from I decided to open up the zip file to have a look through the customizations.xml file. I searched for the guid and could see that the Quick View form was as expected included correctly and the reference to it from the related form was also included.

The only thing I could think was that the form that referenced the quick view form was included in the Xml before the actual form that contained the quick view definition. I moved the element containing the quick view form above the that was referencing it, repackaged and tried again. This time the import work successfully!

So:

1. Open up your solution zip and edit the customizations.xml file searching for the guid provided in the solution import error log.

2. For each <Entity> that uses the Quick Form you’ll see it contains a <QuickFormIds> element similar to that shown below. You need to make sure that the <Entity> element for the entity it refers to (xyz_entityName in this case) appears in the file BEFORE the <Entity> that is referencing it via the QuickFormIds element.

There’s plenty of information available on the net for configuring your visual diff/merge tool of choice for git. However, a lot of it is out of date. As of Jan 2014 using git v 1.8.4 this is the concise guide to setting up your visual diff and merge tool(s) of choice.

Add the following to your .gitconfig. If you don’t know what that is go here.

Git is a fantastic version control system but it was never designed for storing binary files. They clutter the history and even if removed that history must still be maintained. Ideally a remote pull should be a fast and pain free operation; one of the core tenets of git is speed. Something that anyone who has spent any amount of time within TFS will appreciate.

The screenshot below shows the packages folder of a newly created ASP.NET MVC 4 project. I appreciate some of these are scripts but that’s 47MB (before adding any project specific packages such as DI or Mocking) of binary data your git repo needs to maintain history for, binary history that you’re unlikely to ever care about.

You may now be thinking “What if we need to revert to an earlier build?”. You can still do this using the exact same binary versions as when you created the commit. Simply check out the commit and build the solution as normal. Your packages will be restored to the exact versions at the time of the commit because the packages.config file which defines the versions of those packages is stored in your repo.

Let’s fix this…

Enable NuGet Package Restore by right clicking on your VS solution. This will as the name suggests ensure on build of the solution that all package dependencies are pulled in from the configured nuget repositories. What to restore is defined in the packages.config file which is stored in the root of each project in the the solution. As mentioned earlier these will be version controlled which is what allows us to always restore source and package dependencies for any commit in the history. More info on this feature is available on the NuGet website.

Add the line packages/ to your gitignore file. This is the important bit and something a lot of people forget to do.

Each time I want to create a quick project in Visual Studio to connect to CRM 2011 I head to the SDK and pull in Microsoft.Xrm.Sdk then the source code for the helper classes and finally resolve all the missing framework dependencies IdentityModel, DirectoryServices etc. The latter being made considerably easier with Resharper.

I’ve been meaning to package up this process that I’ve now repeated far too many times and throw it up on Nuget. I finally managed to find the huge 10 minute commitment it eventually took to get this done tonight.

Available on the gallery or to install the package in Visual Studio just open up the Package Manager console and type:

Having just watched Brian Keller’s talk at //Build online I decided to give the new Team Foundation Service offering a spin. It’s free for teams of up to five users and whilst in preview also free for larger teams. No confirmed pricing plans yet so let’s hope MS don’t go silly if they really want to complete with the likes of GitHub and AppHarbor.

Setup is an absolute breeze having just created an account with my Live ID I was able to create a Team Project and start creating tasks in seconds. Make sure you pick your org name carefully as it cannot be changed at a later date. It also forms part of your URL so company name will be the obvious choice over a specific project name.

Hooking into Visual Studio 2012 is equally easy using the Team Explorer dialog to add a new server you just enter your URL http://xyz.visualstudio.com and you’ll be prompted for Live ID and you’re up and running. I just tried creating a task, pushing it to Outlook (2013) and following the link to view online and all went well. Having been through the pain of setting up an on-premise TFS environment including the SharePoint, SQL Reporting and Build Controllers this is a real step forward for smaller teams and I’ll definitely be digging in a lot more.

In an upcoming post I’ll be taking a closer look at the Azure Continuous Deployment Build Definition and comparing this with the new Continuous Deployment offering for GitHub and CodePlex integration introduced to Azure Websites recently.

If you want to try out any of the new Azure features head over to the Azure Website and sign up for the 10 free Azure Websites offering. Alternatively, if you’re a Microsoft Partner you can sign up for Cloud Essentials for your Azure access and whilst you’re there why not get on board with CRM 2011 Online and Office 365 partner access.

If you want to import pictures from a camera or any other USB device straight to a custom SkyDrive folder you can’t do this using the Windows 8 Photo Application. By default it will import all photos to your picture library which won’t be linked to your SkyDrive folder. Whilst you can then upload the imported pictures to SkyDrive manually, this will duplicate the content, it’s far too time consuming and it will also incur the extra download from the SkyDrive servers to sync back with your local SkyDrive folder! There must be a better way.

I’ve fixed this by setting up my pictures library to point straight to the pictures folder within my local SkyDrive folder (which is stored on a second hard disk rather than my SSD where space is always at a premium). That way you’re importing from USB straight to SkyDrive all through the new Windows 8 Photo Application.

Open Windows Explorer (Win + E)

Move all of your pictures from Libraries\Pictures to the folder of your choice within your SkyDrive folder. For most people this will be the default Pictures folder you are provided with SkyDrive.

Right click on Libraries\Pictures and select Properties

Select the path to the current pictures folder most likely C:\Users\username_000. I don’t like the way Windows 8 creates these folder names when using Windows Live for your login.

Click Remove

Click Add

Navigate to the pictures folder within your SkyDrive folder you just moved all your pictures to

Click Include Folder

Click OK.

Click OK.

You now have the Windows 8 Photo Application importing directly to your SkyDrive.

You can also hide the Picture Library from the photo app as this is now just duplicating your SkyDrive folder. Open the charms menu (Win + C) inside the Photo App. Select Settings, Options and uncheck Picture Library. Alternatively you could setup a new “Local” picture library as I have done for importing/storing images you don’t want synced to the cloud.