Dynamics CRM automated deployment using dynamics crm developer toolkit from the SDK

Microsoft Dynamcis CRM developer toolkit that comes with the CRM SDK provides a wide variety of useful features. If you have created a Dynamics CRM Solution in Visual Studio using the Developer toolkit add-on that gets installed onto your Visual Studio, you can easily deploy your Dynamics CRM code directly by right clicking on the CRMPackage project of the solution and clicking deploy. This Deploy command will build and deploy all your plugins, custom workflows, web resources, etc.

In a previous post, I wrote about automated deployment of Dynamcis CRM using MSBuild from Visual Studio to your Dynamics CRM Server. In this post though, I will cover how to use the deploy command of the developer toolkit to automate your deployment of Dynamics CRM Visual Studio solutions onto your Dynamics CRM organisation.

The deploy command can be easily accessed from the Visual Studio Command prompt. You can then call the deploy command in the command shell. To make it easier, you can create a batch file that calls Visual Studio command prompt, navigates to where your CRMPackage project is and then finally calls the deploy command. This batch file can then be scheduled to run using a Windows Scheduled Task to automate the deployment of your Solution at pre-scheduled times.

Sample code for the deployment automation batch file to deploy the CRMPackage project is below:

call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
cd C:\Users\YourUser\Documents\Visual Studio 2010\Projects\CRM-Solution-Folder
devenv crm-solution.sln /deploy "debug"  /project CrmPackage

Enjoy! Tried and Tested.

4 Replies to “Dynamics CRM automated deployment using dynamics crm developer toolkit from the SDK”

  1. Nice work! I had been trying to figure this out for some time now, but was trying to do it directly through an msbuild call. I was getting nowhere. The devenv call works great and this is now the missing piece to a large amount of build automation that I’m putting together. I can’t thank you enough for sharing!

  2. Hi, I am able to execute this command but this gives a popup to connect to the Microsoft Dynamics CRM Toolkit. How can we pass all the information to that through command line. Any help on that would be of great help.

Please comment or leave feedback