Dynamics CRM 2015 SDK and Developer Toolkit

The new CRM SDK  2015 doesn’t give support yet for our known CRM Developer Toolkit,  which has been part of the CRM SDK until CRM 2013. Basically, the CRM SDK 2015 assemblies have been compiled with .NET Framework 4.5.2, but CRM Developer Toolkit was compiled using NET Framework 4.5. See the next Microsoft article for more details.

For instance, let’s check the new assembly Microsoft.xrm.sdk.dll part of the CRM SDK 2015: 

SDK2015_Microsoft.Xrm.Sdk_ILSpy

 

The good news are… we still can make compatible the Developer Toolkit with the latest CRM SDK 2015 editing the .NET Framework in the corresponding projects of our Visual Studio solution. Let’s say we have the next CRM solution:

CRM_DeveloperToolkit_SampleSolution

 

For plugins and workflows, we should update the references to the new assemblies and also the .NET Framework in the project properties:

CRM_DeveloperToolkit_UpdateAssemblyReferences

After updating those references, we could still find the following error:

“The type or namespace name ‘Xrm’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?)”

This error is indicating you haven’t got installed the expected .NET Framework 4.5.2. Do right click on the same project and select Properties to check the version actually used:

CRM_DeveloperToolkit_TargetFramework_4.5.1

If you are only getting old versions of the Target Framework, select “Install other frameworks…” that will take you to the next site:

http://blogs.msdn.com/b/dotnet/p/dotnet_sdks.aspx

There you must download .NET Framework 4.5.2 Developer Pack.

After it has been installed, you get a new option in that previous list:

CRM_DeveloperToolkit_TargetFramework_4.5.2

Finally, we need to do something similar with the CRM Package Project. But in this case, we will have to edit the project file and update the entry “TargetFrameworkVersion” to “4.5.2”. Start unloading the project:

UnloadCRMPackageProject

Update the mentioned entry “TargetFrameworkVersion“:

EditCRMPackageProject

Finally, reload the project again and everything should work now!

ReloadCRMPackageProject

About this last part, I would like to say thanks to my CRM MVP colleague Scott Durow (@ScottDurow), who helped me to find that entry.

If you don’t update the package project, it may still compiled, but the actual deployment will fail and you should see the next warning in the Visual Studio output:

warning MSB3274: The primary reference “[Your Assembly Name].dll” could not be resolved because it was built against the “.NETFramework,Version=v4.5.2” framework. This is a higher version than the currently targeted framework “.NETFramework,Version=v4.5”

warning MSB3275: The primary reference “[Your Assembly Name].dll” could not be resolved because it has an indirect dependency on the assembly “Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” which was built against the “.NETFramework,Version=v4.5.2” framework. This is a higher version than the currently targeted framework “.NETFramework,Version=v4.5”

Advertisements

Posted on March 24, 2015, in CRM, CRM Online, CRM SDK, Development, Visual Studio and tagged , , , . Bookmark the permalink. 2 Comments.

  1. Reblogged this on mfonsell and commented:
    Ramon and Scott writing about Dynamics CRM SDK and .NET compatibility. Well done!

  2. Thanks for this article

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: