You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Compiling the solution with AnyCPU does not work #4161
Compiling the project with the default configuration will lead to the following output:
Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
Steps to Reproduce
Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)
Steps to reproduce the behavior:
Open solution
Compile solution
See error
Expected behavior
No error
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
NuGet Package(s):
Package Version(s):
Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (build number: )
App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)
Device form factor:
- [ ] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT
Visual Studio
- [ ] 2017 (version: )
- [ ] 2019 (version: )
- [ ] 2019 Preview (version: )
Additional context
Compiling manually the BackgroundTasks project fixes the issue.
Steps:
1- Clone to a fresh folder
2- Build solution (there will be no error)
3- Open the Samples folder in the Solution Explorer and select Microsoft.Toolkit.Uwp.SampleApp then right click Build
I don't think this is related to @Nirmal4G's work. UWP never supported AnyCPU as a target. You need to select a specific architecture. That is by design.
Is the underlying issue that the default solution configuration/platform when you freshly clone the repo is equal to Something/AnyCPU? Not sure how to change that.
Both @Rosuavio and @azchohfi are right. This might've been my updates to the solution file. But also, a side effect of fixing the solution config.
See that the BackgroundTasks project is skipped when Any CPU is selected in the attached build log.
9>------ Skipped Build: Project: Microsoft.Toolkit.Uwp.Samples.BackgroundTasks, Configuration: Debug Any CPU ------
9>Project not selected to build for this solution configuration
Activity
Rosuavio commentedon Aug 5, 2021
I am having no problems building the solution. Could you share the output for the build from the
outputtab?ArchieCoder commentedon Aug 5, 2021
@RosarioPulella [
output.txt
](url)
Steps:
1- Clone to a fresh folder
2- Build solution (there will be no error)
3- Open the Samples folder in the Solution Explorer and select Microsoft.Toolkit.Uwp.SampleApp then right click Build
Errors are shown in the output.txt file.
Rosuavio commentedon Aug 5, 2021
I am seeing the issue locally now, thanks @ArchieCoder.
Rosuavio commentedon Aug 5, 2021
@Nirmal4G I have a hunch this is related to recent project files refactor, can you help shed some light on this?
azchohfi commentedon Aug 5, 2021
I don't think this is related to @Nirmal4G's work. UWP never supported AnyCPU as a target. You need to select a specific architecture. That is by design.
Is the underlying issue that the default solution configuration/platform when you freshly clone the repo is equal to Something/AnyCPU? Not sure how to change that.
Nirmal4G commentedon Aug 5, 2021
Both @Rosuavio and @azchohfi are right. This might've been my updates to the solution file. But also, a side effect of fixing the solution config.
See that the
BackgroundTasksproject is skipped whenAny CPUis selected in the attachedbuildlog.Let me check and report back!
ArchieCoder commentedon Aug 5, 2021
If WCT will never support Any CPU, it can be removed from the solution entirely.

Try re-ordering Solution File Targets for #4161
Nirmal4G commentedon Oct 14, 2021
@ArchieCoder There were a few updates to solution file since then. Can you confirm if this is fixed in my PR #4234?
ArchieCoder commentedon Oct 14, 2021
@Nirmal4G Build succeeded on the first F6! Thank you