Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Processor architecture mismatch building error

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"

like image 956
prcontra Avatar asked Sep 28 '15 13:09

prcontra


2 Answers

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.

like image 62
Ade Stringer Avatar answered Oct 12 '22 11:10

Ade Stringer


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

like image 31
vvolkgang Avatar answered Oct 12 '22 12:10

vvolkgang