CRM 2011 Developer Tools target location for Visual Studio 2010 vs Visual Studio 2012
The imported project “C:Program Files (x86)MSBuildMicrosoftCRMMicrosoft.CrmDeveloperTools.CrmClient.targets” was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
or when attempting to deploy the CrmPackage project from Visual Studio 2010 as the error
Error connecting to CRM Server. [A]Microsoft.CrmDeveloperTools.CrmClient.Entities.Solution cannot be cast to [B]Microsoft.CrmDeveloperTools.CrmClient.Entities.Solution. Type A originates from ‘Microsoft.CrmDeveloperTools.CrmClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘LoadFrom’ at location ‘C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEExtensionsMicrosoftDynamics CRM 2011 Developer Tools1.0Microsoft.CrmDeveloperTools.CrmClient.dll’. Type B originates from ‘Microsoft.CrmDeveloperTools, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘LoadFrom’ at location ‘C:Program Files (x86)MSBuildMicrosoftCRMMicrosoft.CrmDeveloperTools.dll’.
or when attempting to deploy the CrmPackage project from Visual Studio 2012 as the error
Error connecting to CRM Server. [A]Microsoft.CrmDeveloperTools.CrmClient.Entities.Solution cannot be cast to [B]Microsoft.CrmDeveloperTools.CrmClient.Entities.Solution. Type A originates from ‘Microsoft.CrmDeveloperTools, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘LoadFrom’ at location ‘C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDEExtensionsMicrosoftDynamics CRM 2011 Developer Tools1.0Microsoft.CrmDeveloperTools.dll’. Type B originates from ‘Microsoft.CrmDeveloperTools.CrmClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ in the context ‘LoadFrom’ at location ‘C:Program Files (x86)MSBuildMicrosoftCRMMicrosoft.CrmDeveloperTools.CrmClient.dll’.
depending on the combination of Visual Studio version, installed Developer Toolkit version and previously installed Developer Toolkit versions.
In order to resolve any of these, make sure that the correct targets are referenced in the CrmPackage.csproj file:
- In Visual Studio, right click the CrmPackage project and click Unload Project.
- Right click on the CrmPackage project and click edit CrmPackage.csproj.
- Find the line starting with “<Import Project=”$(MSBuildExtensionsPath32)MicrosoftCRM” and replace it with the correct path from the list below.
- Save and close the file.
- Right click on the CrmPackage project and click Reload Project.
< Import Project = "$(MSBuildExtensionsPath32)MicrosoftCRMMicrosoft.CrmDeveloperTools.CrmClient.targets" /> |
< Import Project = "$(MSBuildExtensionsPath32)MicrosoftCRMMicrosoft.CrmDeveloperTools.12.targets" /> |