Tuesday, December 2, 2014

Install CRM Developer Tookit in Visual Studio 2013 - Repost

I ran into this problem today trying to open a Plugin project on a PC that I hadn't installed the CRM Developer Toolkit on to yet.  Not sure why the SDK doesn't support VS 2013, which is now almost 2 years old?

I ran across this blog post with a fix, so I am copying it here.

(Edit: This was the original site, but it seems to be offline now? http://www.hashtagcrm.com/?p=79)

(Edit: New Site: http://torsteinutne.com/2014/03/24/getting-the-crm-developer-toolkit-to-work-with-visual-studio-2013/)

(Update: April, 2016:  I have tried this trick with Visual Studio 2015, but can't get it to work.  My recommendation for VS2015 going forward is to use the Dynamics CRM Developer Extensions developed by Jason Lattimer.)


If you’re anything like me, then you generally prefer to be using the latest and greatest technology, unless there is a tremendously compelling reason not to. You also dislike the inconvenience of having to use two different tools when one should be capable of everything you need.

For most people Visual Studio 2013 is not a huge change from 2012. There are a few minor visual differences, but it looks pretty much the same. There’s several convenience features, like the cloud integration that automatically loads your settings on any computer you log in to. Several new technologies were introduced in VS2013 such as MVC5 and WebApi 2.0, which I’ve recently started using and am not looking back. It’s got enough new changes that I strongly prefer it over 2012 and I would love to use it exclusively, except for one painfully obvious thing… The CRM Developer Toolkit.

A more patient person might just wait until a new version is released as part of the SDK. But then I thought about the CRM Report Authoring Extensions (*cough* *cough* *hint* *hint* Microsoft), that still hasn’t moved past VS2010. So I’m not going to hold my breath for this update. But VS2012 and 2013 are so similar, I’d doubt there’s any major compatibility issues for this little plugin. So let’s see what we can do:

Step 1 :

Extract the contents of CrmDeveloperToolsVS12_Installer.msi

  1. Open a Command Prompt as Administrator
  2. Navigate to: sdk\Tools\DeveloperToolkit\
  3. Run: msiexec /a CrmDeveloperToolsVS12_Installer.msi /qb TARGETDIR=<EXTRACTFOLDER>


Step 2 :

Modify the VSIX package

  1. Navigate to the folder which you extracted the files
  2. Open the Visual Studio folder
  3. Open the archive file Microsoft.CrmDeveloperTools.vsix (I used 7-Zip for this)
  4. Edit extension.vsixmanifest
  5. Replace: InstalledByMsi=”true” with: InstalledByMsi=”false”
  6. Replace all instances of: Version=”[11.0,12.0)” with: Version=”[11.0,12.0]“ (note the closing bracket changed)
  7. Update the file in the archive


Step 3 :

Install the package
Double click to install the VSIX package Microsoft.CrmDeveloperTools.vsix
Looks promising so far. Click Install.
Sweet! But does it actually work?

Step 4 :

Verify

  1. Start up VS2013 and create a new CRM Solution Project
  2. You should get the Connect to CRM window, and it should connect as normal
  3. Test out whatever you may use on a regular basis
  4. Profit.


So there you go! CRM Developer Toolkit in Visual Studio 2013. The best part is that it “just works”. It didn’t require any changes for compatibility, other than explicitly allowing it to be installed in VS2013.

So far everything I’ve tried is working perfectly, not a single hiccup. With this, there’s no more need to keep both versions of VS installed. Let me know in the comments below if this works for you too, or if you run into any features of the dev kit that’s not working yet in 2013.

I should probably put a legal disclaimer on this one. Of course this is not supported by anybody, and any harm that may come to you or your computer or anyone/anything else in the process of attempting these steps is in no way the responsibility of myself or of hashtagcrm.com.

UPDATE Feb 26, 2014: If you are running Visual Studio 2013 and 2012 on the same machine, you’re probably getting a: “Could not load file or assembly ‘Microsoft.Windows.Design.Host” error. To resolve this issue you must copy the contents of the CRM MSBUILD folder you extracted from the msi package to: C:\Program Files (x86)\MSBuild\Microsoft\CRM
Also, you must edit C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config, add the following lines:

<dependentAssembly>
<assemblyIdentity name=”Microsoft.Windows.Design.Host” publicKeyToken=”b03f5f7f11d50a3a” culture=”neutral” />
<bindingRedirect oldVersion=”4.0.0.0-4.1.0.0″ newVersion=”4.2.0.0″ />
</dependentAssembly>

Thanks to Eduardo for sharing that fix!

On a last note, if you have both VS2012 and VS2013, and you uninstall VS2012 that seems to cause additional issues that I have not resolved yet.

1 comment:

  1. Hi Eduardo,

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

    https://community.dynamics.com/crm/b/tsgrdcrmblog/archive/2014/08/23/microsoft-dynamics-crm-2013-toolkit-with-visual-studio-2013#pi51252=2

    https://crmbusiness.wordpress.com/2015/06/05/getting-the-crm-developer-toolkit-working-with-visual-studio-2013/

    I am able to do the below steps:

    1. Create New Project in Visual Studio
    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

    ReplyDelete