Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes the MSB3270 error code.
Message 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.
Description
The message indicates that you're trying to use a dependency from an architecture that doesn't match the target architecture configured for your project.
Resolution
First, confirm your target architectures are correct. Then make sure all referenced dependencies match the target architecture.
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>
The current platform setting is visible on the menu bar in the Visual Studio IDE. Notice the value between the green Start button and the Configuration dropdown list. The current target platform is usually set at the solution level to control the builds for every project. If you need to view or change the platforms for the solution, see Configure projects to target platforms.
The platform for an individual project can also be viewed and configured in the Project Properties. In Solution Explorer, right-click the project node and select Properties, or use the Alt+Enter keyboard shortcut to open the project properties editor. For C# projects, expand the Build tab, and find the Platform target setting. For .NET Framework and all Visual Basic projects, choose the Compile tab and find Target CPU.
For more information, see MSBuild target framework and target platform.
Applies to
All versions of MSBuild