Install CRM 2013 Developer Toolkit on Visual Studio 2013

I had a hard time to install the CRM developer toolkit found in CRM 2013 SDK on VS 2013 that is running on Windows Server 2012 R2, so I thought of sharing the steps to make this happen:

  1. Download the CRM 2013 SDK and after extracting it navigate to: sdk\Tools\DeveloperToolkit\
  2. Open a Command Prompt as Administrator
  3. Run: msiexec /a CrmDeveloperToolsVS12_Installer.msi /qb TARGETDIR=c:\temp
  4. Navigate to the folder which you extracted the files
  5. Open the Visual Studio folder
  6. Open the archive file Microsoft.CrmDeveloperTools.vsix (I used 7-Zip for this)
  7. Edit extension.vsixmanifest
  8. Replace: InstalledByMsi=”true” with: InstalledByMsi=”false”
  9. Replace all instances of: Version=”[11.0,12.0)” with: Version=”[11.0,12.0]“ (note the closing bracket changed) and update the file in the archive.
  10. Double click to install the VSIX package Microsoft.CrmDeveloperTools.vsix found in the visual studio folder.
  11. Add the files found in the folder named “CRM MSBuild” extracted from the CrmDeveloperToolsVS12_Installer.msi to the folder in the path “C:\Program Files (x86)\MSBuild\Microsoft\CRM”
  12. If things didn’t work out you may need to edit C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config and add the following lines:
    <assemblyIdentity name=”Microsoft.Windows.Design.Host” publicKeyToken=”b03f5f7f11d50a3a” culture=”neutral” />
    <bindingRedirect oldVersion=”″ newVersion=”″ />

In case the CRM explorer window is not loading when opening the CRM Toolkit project types you will need to add the below lines in the visual studio solution file:

  GlobalSection(CRMSolutionProperties) = preSolution
    SolutionIsBoundToCRM = TRUE

Changing Dynamics CRM Service Accounts

If we needed to change CRM service accounts at any point of time due to password loss or the need of setting specific SPN accounts as services accounts we can use the CRM repair wizard by running the installer and selecting the repair options, this option applies this change smoothly and without affecting the current CRM deployment.

Installing CRM 2011 on Windows Server 2012 R2

After upgrading the OS from Windows Server 2008 R2 to Windows Server 2012 R2 I found that all IIS websites and app pools were deleted and was faced with the below message when trying to open IIS 8.5:

One or more problems have been detected during IIS upgrade. As a precaution, one or more IIS services have been disabled. Please review the following error messages:

Data loss has occurred
You upgraded your operating system or switched from one Windows SKU to another SKU, and data from the previous installation of IIS has been lost or copied incorrectly. As a result, the services W3SVC and MSFTPSVC have been disabled. Before enabling these services, you should review the latest IIS 7.0 compatibility information.

You will need to install latest windows updates first then enable the disabled WWW service as well as start other services that were stopped afterwards you should repair or reinstall CRM 2011 to recreate the CRM IIS website and application pool.

There are many articles on the internet showing how the install CRM 2011 on Windows Server 2012 R2 after updating the setup files like that one:

The 2 points to consider after the installation specially when upgrading from Windows Server 2008 R2 is to update the URL rewrite module to version 2.0 to be compatible with IIS 8.5 and ensure that the application pool account is having read permission on the CRMWeb folder.

CRM 2011 Deletion Service Error

We encountered a daily error reported by the deletion service as follows:

Error: Deletion Service encountered an internal error for
Exception: System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Error: Deletion Service failed to clean up the PrincipalObjectAccess table for
Exception: System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

The deletion service was scheduled to run at 7 AM at the start of the core business hours and that error caused strange CRM outage in which CRM is showing 404 directory not found error without any further errors thrown on the front end servers.

The first quick resolution we applied by modifying the deletion service scheduled execution time using the great tool CRM 2011 Job Editor

Second resolution which take around a month with Microsoft premier support was to clear the table named [SubscriptionTrackingDeletedObject] in the CRM organization database, you need to make sure before clearing that table that all users using CRM for Outlook are in Online mode at that time (that in case you are using the offline mode in your company)  and that made the magic and stopped the deletion service error.

Dependent Dlls Location for Dynamics CRM Plugins & Workflows

Some developers take the easy approach and add the plugin or custom workflow activity dependent DLLs in the server GAC. This approach for some cases may not be valid specially that it requires administrative rights on the server.

Others use ILMerge to merge the plugin Dll with the dependent Dlls which causes an update for the whole Dll in case you are updating a single Dll.

I prefer another approach which is putting the dependent Dlls on the server bin folder which differs in case of WFE server than that for a back end asynchronous server.

For the front end server you can place the Dlls in that path:

C:\Program Files\Microsoft Dynamics CRM\CRMWeb\bin

On the back end server you can place the Dlls in that path:

C:\Program Files\Microsoft Dynamics CRM\Server\bin

Please note that if the Dlls are already in the GAC then for some cases the version in the GAC will be used, I suggested having these Dlls in only one place.

Audit Partition Deletion Failure CRM 2011

I was trying to clear old Audit Partitions data from the CRM web interface for production environment with UR 17 installed but faced the below error:

“Failed to drop Partition on AuditBase. Exception message Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.”

The resolution is found in the below KB article by applying both methods on one of the WFE CRM servers:

Although the KB article title is different than the issue but it solved the problem 🙂

CRM 2011 Charts Percentage Labels

The decision maker usually needs percentage charts instead of showing numbers, to display percentage for CRM 2011 charts you can export the chart XML and add the following XML attributes to have percentage labels:

<Series ShadowOffset=”0″ Label=”#PERCENT” IsValueShownAsLabel=”False” LabelFormat=”#0.##%” Font=”{0}, 9.5px” LabelForeColor=”59, 59, 59″ CustomProperties=”PieLabelStyle=Inside, PieDrawingStyle=Default” ChartType=”pie”>
<SmartLabelStyle Enabled=”True” />