Edit

Share via


MSB3270: There was a mismatch between the processor architecture of the project being built 'arch' and the processor architecture of the reference 'reference', 'arch'

The complete message is similar to the following text:

MSB3270: There was a mismatch between the processor architecture of the project being built 'architecture' and the processor architecture of the reference 'dependency', 'architecture'. 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.

Possible causes

The message says that you are trying to use a dependency that is of an architecture that doesn't match the target architecture your project is configured for. You first need to confirm your target architectures are correct, and then make sure that all dependencies that are referenced match that target architecture.

In Visual Studio, you can use the Configuration Manager to control which architectures are built.

In MSBuild, the PlatformTarget property is used to define the target platform.

Setting the MSBuild property ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch to None or Warning in the project file suppresses this warning:

<PropertyGroup>
   <!-- other property settings -->
   <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>

See also