Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
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

Open

Description

@ArchieCoder

Describe the bug

Compiling the project with the default configuration will lead to the following output:

image

  • 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:

  1. Open solution
  2. Compile solution
  3. 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.

Activity

  1. added
    bug 🐛An unexpected issue that highlights incorrect behavior
    on Aug 4, 2021
  2. Rosuavio commented on Aug 5, 2021

    @Rosuavio
    Contributor

    I am having no problems building the solution. Could you share the output for the build from the output tab?

  3. ArchieCoder commented on Aug 5, 2021

    @ArchieCoder
    ContributorAuthor

    @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.

  4. Rosuavio commented on Aug 5, 2021

    @Rosuavio
    Contributor

    I am seeing the issue locally now, thanks @ArchieCoder.

  5. Rosuavio commented on Aug 5, 2021

    @Rosuavio
    Contributor

    @Nirmal4G I have a hunch this is related to recent project files refactor, can you help shed some light on this?

  6. azchohfi commented on Aug 5, 2021

    @azchohfi
    Contributor

    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.

  7. Nirmal4G commented on Aug 5, 2021

    @Nirmal4G
    Contributor

    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
    

    Let me check and report back!

  8. ArchieCoder commented on Aug 5, 2021

    @ArchieCoder
    ContributorAuthor

    If WCT will never support Any CPU, it can be removed from the solution entirely.
    image

  9. added this to the 7.1 milestone on Aug 5, 2021
  10. modified the milestones: 7.1, 7.2/8.0? on Aug 31, 2021
  11. ghost removed this from the 7.2/8.0? milestone on Aug 31, 2021
  12. Nirmal4G commented on Oct 14, 2021

    @Nirmal4G
    Contributor

    @ArchieCoder There were a few updates to solution file since then. Can you confirm if this is fixed in my PR #4234?

  13. ArchieCoder commented on Oct 14, 2021

    @ArchieCoder
    ContributorAuthor

    @Nirmal4G Build succeeded on the first F6! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions