Partilhar via


MSB3271

The complete error is similar to the following:

There was a mismatch between the processor architecture of the project being built "project" and the processor architecture, "architecture", of the implementation file "filename" for "WinMD file". 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 implementation file, or choose a winmd file with an implementation file that has a processor architecture which matches the targeted processor architecture of your project.

The WinMD file is the Windows Metadata file, which contains type information for UWP or WinRT applications that enables language projection. See WinMD files.

If you can, follow the advice in the error text and change the processor architecture as suggested, either in the Configuration Manager in Visual Studio, or in the project file.

In some cases, you can ensure in your own code that the dependent assembly is not loaded in a context that would create a compatibility conflict, and you might want to change this error into a warning. You can do that by setting the property ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch to Warning or None.

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