Applies to: December 2016 Update for Microsoft Dynamics 365 (online) and December 2016 Service Pack for Microsoft Dynamics 365 (on-premises)
This year brought major changes to the Microsoft CRM platform... (Continue reading)

When it comes to transitioning to the next generation of marketing and customer engagement automation tools from Microsoft, there are a few topics of interest:
The life cycle of Dynamics Marketing... (Continue reading)

Businesses today demand apps which are streamlined and focused on making their employees agile and productive.
There is a huge uptake in the demand for such apps but at the same time the app creation... (Continue reading)

Applies to Dynamics 365 Online
With the current release of Dynamics 365, we are introducing the concept of tailored, purpose-built apps for business functions. Our view is that these apps will simplify... (Continue reading)

How to build and run the Dynamics CRM SDK samples on Windows Server 2012 and Windows 8

Have you built a new Windows Server 2012 or Windows 8 computer or virtual machine only to find out that the Microsoft Dynamics CRM 2011 SDK managed code samples no longer compile? You may get build errors similar to the following:

'Microsoft.IdentityModel.Protocols.WSTrust.RequestSecurityTokenResponse' does not contain a definition for... Could not resolve this reference. Could not locate the assembly "Microsoft.IdentityModel"

This is a known problem and has to do with changes in Windows Identity Foundation (WIF). When Microsoft updated WIF 3.5 to the latest WIF 4.5 there was a change in the identity namespace name, and various method changes that are used by the Dynamics CRM SDK samples.

The good news is that there are easy fixes you can apply to build the SDK samples. On your Windows Server 2012 or Windows 8 computer, run a Command Prompt window or PowerShell window as administrator. Next, enter the following command to enable WIF 3.5.

dism /online /enable-feature:windows-identity-foundation

Similarly, you can disable WIF 3.5 using the following command.

dism /online /disable-feature:windows-identity-foundation

Notice that you are not downloading and installing the WIF 3.5 SDK as was documented in the 2011 SDK. Those instructions do not apply to Windows Server 2012 and Windows 8.

After you do this, most of the managed code samples in the SDK should compile and run.

However, the Windows Azure code samples located in the SampleCode\CS|VB\Azure folder of the SDK download need a little attention of their own. After you install the required Azure SDK 1.8 or later on your computer or VM as instructed by the SDK documentation, you must remove and re-add the Microsoft.ServiceBus.dll assembly reference in each listener application's project. The Windows Azure samples should now build. The QueuedListener sample will compile with warnings because it uses the now obsolete .NET classes. The provided PersistentQueueListener sample is an updated version of that same sample.