Why is the DLL from the PCL project an x86 assembly?

I have a C # project in Visual Studio 2012, which is a PCL designed for these platforms (I deleted the names):

enter image description here

When I try to add a dll from a successful build to a Silverlight 5 project in VS2013, I get this warning, and it does not seem to actually be added:

Warning 1 There was a mismatch between the processor architecture of the project "MSIL" and the processor architecture of the link "[Name]", "x86". This mismatch can lead to runtime failures. Please consider changing the target processor architecture of your project through Configuration Manager to align processor architectures between your project and the links, or depend on links to the processor architecture that matches the target processor architecture of your project.

enter image description here

Why will PCL appear as x86?

+6
source share
1 answer

When you have a PCL project for several purposes, and you want to abstract the output of the .dll in other projects, make sure you select the correct .dll with the correct compilation.

For instance:

  • 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 WindowsPhone proj When you go to add a link, you must choose the one that was compiled for ARM [note that if you want to run the emulator, you must choose the x86 version because the emulator is not ARM]. If you add the x86 version and you install it in ARM in the configuration manager, Visual Studio will warn you with the same error as yours, because you will run the ARM code and specify the x86 code.

Check if the .dll you are adding is added with the configuration manager. Change it for the architecture you want instead of "Multiple Platforms" and "Any processor"

0
source

Source: https://habr.com/ru/post/976377/


All Articles