Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSB3271 mismatch between processor architecture when building projection #1097

Open
angelazhangmsft opened this issue Feb 2, 2022 · 0 comments
Labels
bug Something isn't working pri-2 Non-critical bugs/acceptable workaround
Milestone

Comments

@angelazhangmsft
Copy link
Contributor

Describe the bug

An MSB3271 error/warning results when building a projection for AnyCPU while referencing a native C++/WinRT component.

Error message:
Error MSB3271 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture, "x86", of the implementation file "C:\Users\angzhang\repos\CsWinRT\src\Samples\NetProjectionSample_build\Win32\Release\SimpleMathComponent\bin\SimpleMathComponent\SimpleMathComponent.dll" for "C:\Users\angzhang\repos\CsWinRT\src\Samples\NetProjectionSample_build\Win32\Release\SimpleMathComponent\bin\SimpleMathComponent\SimpleMathComponent.winmd". 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.

To Reproduce

See the NetProjectionSample.

Version Info

CsWinRT 1.4.1, .NET 6

Workaround
Add the following property to the library project:

<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
@angelazhangmsft angelazhangmsft added the bug Something isn't working label Feb 2, 2022
@angelazhangmsft angelazhangmsft added the pri-2 Non-critical bugs/acceptable workaround label Apr 1, 2022
@angelazhangmsft angelazhangmsft added this to the 1.6.4 milestone Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pri-2 Non-critical bugs/acceptable workaround
Projects
None yet
Development

No branches or pull requests

2 participants