Geesh_SO
Geesh_SO

Reputation: 2206

Processor architecture mismatch between projects when building C# MVC 5 site

The error I'm getting is as below...

build 20-Apr-2017 13:23:38 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "System.Data", "AMD64". 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. [D:_atlassian-home\bamboo-home\xml-data\build-dir\blah\blah\blah.csproj]

I've seen other people have the same issue, but after following their solutions, it did not improve my situation (Processor architecture mismatch building error).

This is happening on our CI server (Bamboo) when running MSBuild on the solution.

I'm quite stumped, does anyone have any ideas?

Upvotes: 4

Views: 13192

Answers (2)

kammer
kammer

Reputation: 11

After transferring the old project with code to a new computer (Windows 10, 64-bit, VS2012), I received a similar warning. I was installed NET Framework 4.5(or any relevant for you) and select it in 'Target framework' in properties of project. The warning has been removed!

Upvotes: 0

Leo Liu
Leo Liu

Reputation: 76790

First, it really is just a warning. It should not hurt anything if you are just dealing with Amd64 dependencies. If the configuration is set to any CPU, when one of the assemblies is compiled for Amd64, which implies that it will no longer work on any CPU - it'll work only on 64 bit CPU.

Because you have an Amd64 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 "x64".

If you still want to configure your project with "Any CPU", you canedit your project file and add this property group and setting to disable the warning:

<PropertyGroup><ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch></PropertyGroup>

Hope this can help you.

Upvotes: 10

Related Questions