"Could not load file or assembly" error when compiling an SDK application for Microsoft Dynamics SL

This article provides a solution to an error that occurs when you compile a Microsoft Dynamics SL Software Development Kit (SDK) application for Microsoft Dynamics SL.

Applies to:   Microsoft Dynamics SL 2011, Microsoft Dynamics SL 2011 Service Pack 1
Original KB number:   2685036

Symptoms

When you compile a Microsoft Dynamics SL Software Development Kit (SDK) application on a 64-bit workstation, you receive the following error:

Could not load file or assembly 'Solomon.Kernel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Cause

Because Microsoft Dynamics SL is 32-bit code, applications that use the Microsoft Dynamics SL Software Development Kit (SDK) have to target the x86 CPU.

Resolution

In Microsoft Visual Studio, set the advanced compile options to target the x86 CPU. To do it, follow these steps:

  1. Open the SDK project in Microsoft Visual Studio.
  2. From the Project menu, select Properties.
  3. On the Compile tab, select Advanced Compile Options....
  4. On the Target CPU: combo-box, select x86.
  5. Save the project and recompile the application.