Using Platform Specific Libraries from a Platform Agnostic Project

Scenario: You are writing an application or library which targets the "AnyCPU" platform, but reference an external library (such as LeadTools) which are platform specific (x86/32 bit, x64/64 bit)

This situation is handled in several places, as there is no one unifying solution which applies to all phases of development.

During the Development Process

Storing the references

Create one folder for each supported platform. These can be placed either in a central location, or a subfolder of the solution/project. Best practice is to name the folder after the target platform. While this is by no means required, it is strongly recommended and urged.

  • x86
  • AMD64
  • IA64 (very rate, not covered in this article, but the same steps apply and will work)


Initial project creation and adding references

Add the references to the project through Visual Studio as you typically would. Choose the binaries which are applicable for the platform which are presently using.
More...


Using Expressions from Windows Workflow (WF) Designer

Working through the book Beginning WF: Windows Workflow in .NET 4.0 by Mark J. Collins, there came a point where the next step is to add an “Add” activity to the workflow (Chapter 4 for those interested). The method given is to make changes directly to the XAML of the Workflow designer, and it would then appear within the designer when switching out of code mode.

Unfortunately, I had a typo somewhere which my brain couldn’t reconcile immediately at this late hour, and took me thirty (30!) minutes and two re-types to get right. It didn’t help that there was no IntelliSense provided from within the XML editor, as I am accustomed to having with typical XAML code when doing WPF or Silverlight development.

More...