James Mundy
James Mundy

Reputation: 4329

Portable Class Libraries not recompiling when Windows Phone app is in ARM build configuration

I've just started working with the Lumia (formerly Nokia) Imaging Library. Due to some restraints of the library it is necessary to use either the ARM or x86 build configurations.

That's fine, but I have three portable class libraries that are referenced by the app. Whenever I make changes to these I have to change the build configuration back to Any CPU and then back to ARM so I can deploy to a device.

If I don't change the build configuration to ANY CPU and back again then the changes I have made are not compiled it seems. My build configuration for x86 looks like this:

enter image description here

So, seeing that the three PCL's only have the ANY CPU build configuration I created x86 for each but building produces the following error:

Platform target 'x86' is not supported by one or more of the project's targets.

Any idea how I can set up the project so that I don't have to build it twice for the ARM and x86 build configurations?

Upvotes: 3

Views: 912

Answers (1)

r2d2rigo
r2d2rigo

Reputation: 813

First, you should enable the Build checkbox in any project that you want to be compiled for the current active platform. If not, that project won't be compiled any more and if it's referenced by any other project, they will fall back to use the cached versions sitting in the bin/obj folders; doing a Clean and Rebuild will highlight which assemblies are being referenced without being compiled first.

Next, think of platforms as configuration options that allow all the projects in a solution to be built with one target architecture or other depending on where are you going to deploy/run them: this is especially useful when you have native code projects that don't support AnyCPU and you want to test them in an emulator (x86) or actual device (ARM). Also, don't mistake the platform name with the actual architecture the project is being built for; it's given the name of the architecture by default but you can change it to whatever your like (for example, Xamarin iOS uses iPhone for ARM builds for physical devices and iPhoneSimulator for x86 simulator ones.

At last, remember that once you add native code projects/libraries to your solution, you must stop using the AnyCPU architecture in any project that references them; a project that must be built for a specific platform (x86/x64 or ARM) can reference AnyCPU assemblies, but not the other way around.

Upvotes: 2

Related Questions