Singapore
Asked — Edited
Resolved Resolved by JustinRatliff!

Mismatch Error?

Hi everyone,

I was just reading up the tutorials provided for the SDK in C#, and this warning would appear in the error list. Can someone explain what caused this error and how to solve it? I don't understand what do they mean by changing the targeted processor architecture of the project

" There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "EZ_B, Version=2014.1.21.0, Culture=neutral, PublicKeyToken=c3a3457c97d352d9, processorArchitecture=x86", "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. "


ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

#1  

First, it really is just a warning. It should not hurt anything if you are just dealing with x86 dependencies. Microsoft is just trying to warn you when your are starting your project is compatible with "Any CPU" but you have a dependency on a project or .dll assembly that is either x86 or x64.

Because you have an x86 dependency, technically your project is therefore not "Any CPU" compatible. To make the warning go away, you should actually change your project from "Any CPU" to "x86". This is very easy to do, here are the steps.

1.Go to the Build|Configuration Manager menu item. 2.Find your project in the list, under Platform it will say "Any CPU" 3.Select the "Any CPU" option from the drop down and then select <New..> 4.From that dialog, select x86 from the "New Platform" drop down and make sure "Any CPU" is selected in the "Copy settings from" drop down. 5.Hit OK 6.You will want to select x86 for both the Debug and Release configurations.

This will make the warning go away and also state that your assembly or project is now no longer "Any CPU" compatible but now x86 specific. This is also applicable if you are building a 64 bit project that has an x64 dependency, you would just select x64 instead.

One other note, projects can by "Any CPU" compatible usually if they are pure .NET projects. This issues only comes up if you introduce a dependency (3rd party dll or your own C++ managed project) that targets a specific processor architecture.