Home » MS CRM4 | MS CRM | MSBuild

A fix for the MSCrm 4 Developer toolkit devbuild.bat not building

10. February 2010 by Dave Hawes 0 Comments

I have just been setting up a new Crm project using the MS Crm4 Developer toolkit. Hats off to the guys at MCS, its a great bit of work and is packed full of amazing features which if used properly will ensure extra quality and best practice in the development of a Crm4 solution.

However I did have a bit of a problem with it which I have managed to fix – the default DevBuild.bat MSBuild script would not register my plugins if I ran my Crm server on any port other than 80!

I had followed the documentation about changing the server names etc. but whenever it tried to register my plugins the build failed.

It turns out that the MSCrm 4 Developer toolkit will only play nicely out of the box if you are running Crm on port 80, I am running on port 5555 though! After digging through the Plugin deployment tool source code I noticed that if the “CrmServiceAddress” was not specified then it made the url up from the CrmServiceServer but this did not include the port. Therefore the solution was to pass in the full Crm Service Address.

So the fix is this:

Edit the <YourSolutionName>.Common.targets file in the following places (changes are in red)


<!-- CRM Server Settings -->
  <CrmServerBinAssemblyDir>C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly</CrmServerBinAssemblyDir>
  <PluginDeveloperArguments Condition="'$(ForceSynchronousPlugins)' == 'true'">/sf</PluginDeveloperArguments>


     WorkingDirectory="$(CrmServerBinAssemblyDir)" >
     <Output TaskParameter="Duplicates" PropertyName="DuplicatePlugins"/>

And Here:

<!-- Unregister a Plugin Solution -->
<Target Name="UnregisterCrmSolution"
        Condition="Exists('$(IntermediateOutputPath)PluginRegister.cache')" >
  <Message Text="Unregistering Crm Solution ... " Importance="high" />

  <Microsoft.Build.Tasks.Delete Files="$(IntermediateOutputPath)PluginRegister.cache" />

Then it seems to work and you can set any port number you want.

Comments are closed