6
votes

I have a C# project in Visual Studio 2012 that is a PCL, targeting these platforms (I removed the names):

enter image description here

When I try to add the dll, from a successful build, to a Silverlight 5 project in VS2013, I am getting this warning and it doesn't seem to actually be added:

Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "[Name]", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

enter image description here

Why would a PCL be showing as x86?

1
Your warning is tiny, please copy/paste the error message into your question bodyeddie_cat
eddie_cat, I added it, although you can also right click on the image and View Image (in Firefox at least).Jake
I don't think it's normal for your Configuration and Platform to be N/A. Try creating a new Configuration with the AnyCPU setting.Theodoros Chatzigiannakis
Theodoros, under the Build tab it does say Platform: Active (Any CPU). I don't know how to create a new configuration.Jake
@Jake My mistake, then.Theodoros Chatzigiannakis

1 Answers

0
votes

When you have a PCL project for multiple targets and you want to referene the output .dll in other projects, be sure that you pick the right .dll with the right compilation.

For example:

  • you have a Business project that is PCL for WP 8 and SL 5.
  • you have 2 projects that reference the dll from the above business project
    • SL proj
    • WP 8 proj

In the WindowsPhone proj When you go to add reference you should pick the one that was compiled for ARM [note that if you want to run on the emulator you should pick the x86 version, because the emulator is not ARM]. If you add the x86 version and in the configuration manager you set it to ARM, Visual Studio will warn you with that same error that you have, because you will run a ARM code and have a x86 code referenced.

Check if the .dll that you add match with the configuration manager. Change it for the right architecture that you want instead of "Multiple platforms" vs "Any CPU"