Windowscommunitytoolkit: UnitTests.XamlIslands.Package build fails when AnyCPU configuration is selected

Created on 4 Dec 2020  ·  3Comments  ·  Source: windows-toolkit/WindowsCommunityToolkit

Describe the bug

When building the toolkit solution with the Debug/AnyCPU configuration selected, the UnitTests.XamlIslands.Package project fails with two errors:

  1. MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\\WindowsCommunityToolkit\UnitTests\UnitTests.XamlIslands\bin\x86\Debug\netcoreapp3.1\UnitTests.XamlIslands.dll", "x86". This mismatch may cause runtime failures...
  2. MSB3779: The processor architecture of the project being built "Any CPU" is not supported by the referenced SDK "Microsoft.VCLibs, Version=14.0". Please consider changing the targeted processor architecture of your project...
  • [ ?] Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
    Unknown. This is my first time building the solution in a several months.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Given the following environment Windows 10 20H2, VS2019.
  2. Select Debug and AnyCPU for build configuration.
  3. Build the solution.
  4. See errors above.

Expected behavior

Build should succeed for any of the available build configs.

Screenshots

image

Environment


Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [x] Version 20H2 (19042.630)
- [ ] Insider Build (build number: )

Visual Studio 
- [ ] 2017 (version: )
- [ x] 2019 (version: 16.8.2) 
- [ ] 2019 Preview (version: )

Additional context

Some other projects target x86 for the AnyCPU config. I'm thinking that this would be the fix for this unit test project.

Completed bug build

All 3 comments

I can take this on and prepare a PR.

Thanks @alvinashcraft! Hopefully just a matter of tweaking the default config checkboxes for that project. Keep us posted!

Thanks @alvinashcraft for finding and fixing this! 🎉🎉🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SmartPolarBear picture SmartPolarBear  ·  4Comments

kusanagi2k2 picture kusanagi2k2  ·  4Comments

shweaver-MSFT picture shweaver-MSFT  ·  3Comments

karmaecrivain94 picture karmaecrivain94  ·  3Comments

michael-hawker picture michael-hawker  ·  4Comments