WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

Compiling the solution with AnyCPU does not work

Open ArchieCoder opened this issue 2 years ago • 10 comments

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.

ArchieCoder avatar Aug 04 '21 19:08 ArchieCoder

Hello ArchieCoder, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

ghost avatar Aug 04 '21 19:08 ghost

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

Rosuavio avatar Aug 05 '21 16:08 Rosuavio

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

ArchieCoder avatar Aug 05 '21 17:08 ArchieCoder

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

Rosuavio avatar Aug 05 '21 17:08 Rosuavio

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

Rosuavio avatar Aug 05 '21 17:08 Rosuavio

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.

azchohfi avatar Aug 05 '21 18:08 azchohfi

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!

Nirmal4G avatar Aug 05 '21 18:08 Nirmal4G

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

ArchieCoder avatar Aug 05 '21 18:08 ArchieCoder

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

Nirmal4G avatar Oct 14 '21 10:10 Nirmal4G

@Nirmal4G Build succeeded on the first F6! Thank you

ArchieCoder avatar Oct 14 '21 14:10 ArchieCoder