Processor architecture mismatch building error

13,639

Solution 1

I finnally was able to build my project without this filthy error. It seems that i needed to install PortableLibraryTools from VS2010. It worked after that.

Reference: http://forums.xamarin.com/discussion/25538/xamarin-xaml-example-problem-using-pcl

Solution 2

Copying over my existing version of .NET Portable Library Reference Assemblies fixed the issue for me.

I encountered this problem after installing a patch to Visual Studio 2015 Update 3, read vvolkgang's response and initially discounted it because I already had folders within C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable, and the dates of those folders were later than those contained within the reference assemblies archive I had downloaded. What I should have done was to check the right part of the folder hierarchy. Take a look at your project file; in my case I had these settings:

<TargetFrameworkProfile>Profile49</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

If those are your settings, you need to check the contents of C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile49. If you're using a different profile or targeting a different version of the framework, adjust the path accordingly. When I checked that folder, I discovered that I had lots of XML files but no DLLs; copying the files from Microsoft .NET Portable Library Reference Assemblies 4.6 and choosing not to replace any files that already existed fixed my build issues.

Solution 3

Had this problem after installing Visual Studio 2015 Update 2. Try this, the first one solved my problem:

Install Portable Class Libraries v4.6

  1. Download Install the Portable Class Libraries v4.6. If you install this it puts a .zip file into the directory: "C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6"
  2. Unpack and copy the contents into "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\"

Install the PCL Tools

  1. Download Portable Class Library Tools
  2. Install by running PortableLibraryTools.exe /buildmachine

Source: Matt Ward @ https://forums.xamarin.com/discussion/comment/80535/#Comment_80535

Share:
13,639
prcontra
Author by

prcontra

Hello world! I'm Pedro Andrade. I'm a Frontend engineer with a great passion for technology and always ready to collaborate. Always happy to help :)

Updated on July 16, 2022

Comments

  • prcontra
    prcontra almost 2 years

    At trying to run a test application i obtain the following error twice:

    There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll", "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. TestMobile.Core mismatch MSIL x86

    I have .NET Framework installed, as well as windows 8 SDK tools and using MultilingualAppToolKit.

    I already have verified the configuration manager and everything seems to be fine. Platform target, targeting "Any CPU"

  • Sam
    Sam over 6 years
    Indeed the folder has been empty on my computer, probably because I had a system crash. I copied the files from some other computer, not it compiles again - thanks a lot!!
  • Mobigital
    Mobigital over 6 years
    fantastic, thank you! I changed my Profile in the csproj file to the highest number and it resolved the issue.