Getting the CRM Developer toolkit working with Visual Studio 2013

Yesterday I wrote Where is the CRM Developer toolkit for CRM 2015? and for the past couple of nights I have been wrestling with Visual Studio Community 2013 and the CRM Developer toolkit trying to get them to place nicely with each other.

Visual Studio Community 2013 is awesome

It’s a Windows 8 laptop and thought I would install the Visual Studio Community 2013 edition of Visual Studio.  So far it’s awesome and means I can have a fully working copy of Visual studio on home computer (which is good and a bit sad at the same time :-))

Microsoft have been awesome and the Visual Studio Community 2013 is a free to individual developers, download and see what’s there in the link below

https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx

The page answers a good question, which I have copied below

Q: Who can use Visual Studio Community?
A: Here’s how individual developers can use Visual Studio Community:
  • Any individual developer can use Visual Studio Community to create their own free or paid apps.
Here’s how Visual Studio Community can be used in organizations:
  • An unlimited number of users within an organization can use Visual Studio Community for the following scenarios: in a classroom learning environment, for academic research, or for contributing to open source projects.
  • For all other usage scenarios: In non-enterprise organizations, up to 5 users can use Visual Studio Community. In enterprise organizations (meaning those with >250 PCs or > $1 Million US Dollars in annual revenue), no use is permitted beyond the open source, academic research, and classroom learning environment scenarios described above.

For more information, please refer to the Visual Studio Community 2013 License Terms and the Visual Studio Licensing Whitepaper.

Q: How does Visual Studio Community 2013 compare to other Visual Studio editions?
A: Visual Studio Community 2013 includes all the great functionality of Visual Studio Professional 2013, designed and optimized for individual developers, students, open source contributors, and small teams.

 

Getting the CRM Developer toolkit working

I had avoided the pain of hacking, nudging, shouting and in the end forcing Visual Studio 2013 to work with the CRM developer toolkit.  I had read about it and it didn’t sound like fun.

It has taken a few hours of getting it to work and has taken a lot of mucking about (technical term).

I thought I would blog down my experiences to help other CRM developers who have to go through this.

The main instructions are in this great blog post from Simon Jenkinson, it’s fortunate he blogged this because the initial blog Hashtagcrm.com no longer works 😦

Microsoft Dynamics CRM 2013 Toolkit with Visual Studio 2013

These are the instructions I have copied from the blog above

The first step is to extract the MSI installer file and modify the VSXI Manifest file

1.       Extract the contents of CrmDeveloperToolsVS12_Installer.msi

2.       Open a Command Prompt

3.       Navigate to the extracted SDK folder e.g. C:\CRM-SDK\sdk\Tools\DeveloperToolkit\

4.       Execute the command msiexec /a  C:\CRM-SDK\sdk\tools\DeveloperToolkit\sdkCrmDeveloperToolsVS12_Installer.msi /qb TARGETDIR=C:\CRM-SDK\Toolkit

5.       Navigate to the folder which you extracted the files

6.       Open the Visual Studio folder

7.       Open the archive file Microsoft.CrmDeveloperTools.vsix, or extract it to a sensible location

8.       Then we need to edit the extension.vsixmanifest, and replace – InstalledByMsi=”true” with InstalledByMsi=”false”

9.       We also need to replace all instances of – Version=”[11.0,12.0)” with: Version=”[11.0,12.0]“  (notice the closing bracket has been changed from ) to ] )

10.   Update the manifest file in the archive or repackage the extracted directory.

The instructions work but there is a couple of tricky bits

Step 4 – Tricky bit

Execute the command msiexec /a  C:\CRM-SDK\sdk\tools\DeveloperToolkit\sdkCrmDeveloperToolsVS12_Installer.msi /qb TARGETDIR=C:\CRM-SDK\Toolkit

You have to make sure the target directory already exists or it won’t work, this stopped me for a while because the error message doesn’t say much.

Step 7 – Tricky bit

Step 7 – Open the archive file Microsoft.CrmDeveloperTools.vsix, or extract it to a sensible location

I could get this to work for quite a while.  The main problem I had was if I extracted the Microsoft.CrmDeveloperTools.vsix, this created a folder Microsoft.CrmDeveloperTools, I then edited extension.vsixmanifest to change the ) to ] and change InstalledByMsi=”false” but then I couldn’t figure out how to re-zip or get it back to being the vsix.

In the end I found the solution was to edit the files inside the files inside the Microsoft.CrmDeveloperTools.vsix.

I will admit I didn’t really know what a vsix file was

What is a VSIX?

The VSIX file is the unit of deployment for a Visual Studio 2010 Extension. Visual Studio will recognize the VSIX extension and install the contents of the file to the right location.
A VSIX file is a zip file that uses the Open Packaging Convention. You can rename the .VSIX extension to .ZIP and use any zip browser (including the Windows File Explorer) to browse its contents.

 

So it’s basically a zip file which holds visual studio extensions, this is good because it means you can edit the contents like this and I guess you could re zip them and then rename to VSIX but I found editing inside the vsix easier.

Open file

edit extension

Once you have changed the values you should be able to double click the VSIX and it will install.

The next stage was to copy the folder CRM MSBuild which has the files below in

  • Microsoft.Crm.Sdk.Proxy.dll
  • Microsoft.CrmDeveloperTools.12.targets
  • Microsoft.CrmDeveloperTools.dll
  • microsoft.xrm.sdk.workflow.dll

I had to copy this folder to this directory and rename CRM MSBUILD to CRM

C:\Program Files (x86)\MSBuild\Microsoft

so you should have this

C:\Program Files (x86)\MSBuild\Microsoft\CRM

In this folder you should have the four files mentioned above.

The last tricky part was changing some reg files, I had some problems with this and it turned out I needed the line

Windows Registry Editor Version 5.00

at the top of the reg file edits, who knew.  The text are in the link below

http://pastebin.com/kYjj9XLg

I did have to install Windows Identity Foundation or rather you enable it in Windows 8, instructions here 

It certainly wasn’t straight forward getting this working.  I am really grateful for Simon to blogging about it and giving some clear instructions and I hope this blog augments those to help people get over a few tricky humps.

17 thoughts on “Getting the CRM Developer toolkit working with Visual Studio 2013

  1. TAM June 15, 2015 / 4:13 pm

    Thanks Hosk

    Like

    • Mow August 12, 2015 / 10:21 am

      Hi,
      Thanks for the post. Very helpful.
      The thing is that I installed de developer toolkit on a machine with visual studio 2013 community and on another laptop with VS 2015 community and i’m getting the same issue.
      All seems to work fine but if i create a CrmPackage and use the option “Add new item” which is supposed to add Dynamics Crm web resources (JavaScript, Css, Xml,…) I always get an empty dialog (No items found).
      Can you confirm it please and if you can help with a workaround.

      Like

      • Phil September 23, 2015 / 7:56 pm

        I have the same issue, did you find a solution?

        Like

      • Mow November 12, 2015 / 2:12 pm

        Hi its me again. I have a temporary solution:

        Step1: Before you proceed, please copy the contents of the installation folder of the toolkit F1= “C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Dynamics CRM 2011 Developer Tools\1.0\ItemTemplates” to the location F2 = “C:\Users\Mow\Documents\Visual Studio 2013\Templates\ItemTemplates” for example.

        Step2: Open your CRMpackage project and go to “Tools -> Projects and Solutions” and toggle the “User item template location :” to one of the paths specified in step 1.
        That’s it, if the last time you used F1 switch it to F2 (and viceversa).

        Step3: Now try to add a NEW item to your Crmpackage project, you will be able to add files from the templates installed with the toolkit.

        Hope this work for you.

        Happy coding 🙂

        Like

  2. Arjun Babu September 27, 2016 / 5:09 pm

    Hi Hosk,

    I am following the steps mentioned above to setup CRM Developer toolkit for Visual Studio 2013.

    I am able to do the below steps:

    1. Create New Project

    2. Connect to Dynamics CRM Server and to the correct Organisation and Solution. (Actually can even browse CRM entities in CRM Explorer)

    After that I get the below error which I am not able to fix

    “System.Exception: general exception (expection from HRESULT: 0x80131500) at EnvDTE100.Solution4.AddFromTemplate(String FileName, String Destination, String ProjectName, Boolean Exclusive) at Microsoft.CRMDeveloperTools.TemplateExtensions.CRMTemplateExtension.RunFinished()”

    Will be helpful if you can help me with this issue please?

    Thanks,

    Arjun

    Like

    • Hosk September 27, 2016 / 6:14 pm

      Raise this as a post on the CRM forum

      Liked by 1 person

  3. Arjun Babu September 28, 2016 / 5:05 pm

    I have posted it in CRM forum. In fact this error happens only when,

    New project type = New Visual Studio Solution Template for Dynamics CRM 2013

    But it works perfect when the new Project Types are,

    Dynamics CRM 2013 Plug-in Library
    Dynamics CRM 2013 Workflow Library

    Not sure why the template type is not working!

    Like

    • Antony Ellis September 29, 2016 / 12:57 pm

      That’s probably because you haven’t created a CRM folder and copied across the 4 files that Hosk mentioned within your MSBuild folder. If you already have files in there delete them and copy across the ones from the extracted folder.

      Like

    • Hosk September 29, 2016 / 10:56 am

      Good stuff. I believe the Developer toolkit will be released in the next couple of months

      Liked by 1 person

      • Antony Ellis September 29, 2016 / 12:53 pm

        That will be awesome mate, article updated for 2015 now. Fingers crossed this will become an obsolete and unnecessary process once new toolkit released.

        Like

  4. Dinesh Raja December 22, 2017 / 7:34 am

    Actually I Install Visual Studio 2012 in my computer & also install CRM Software Development Kit 2013(SDK). While creating plugin in visual studio new window open and ask Connect to CRM Server. Fill up the details and after choose the organization, solution dropdown is not opening. CRM explorer also not show in the view.plz help me

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.