WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

Microsoft.Toolkit.Uwp.UI.Controls V7.1.2 conflict with Microsoft-UI-Xaml V2.8

Open NGame1 opened this issue 2 years ago β€’ 19 comments

Describe the bug

1、After Update to V2.8, got the following error PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry. 2、V2.7.1 works fine

Regression

No response

Reproducible in sample app?

  • [X] This bug can be reproduced in the sample app.

Steps to reproduce

Please compile the attachment project

Expected behavior

Should compile without errors 😁

Screenshots

No response

Windows Build Number

  • [ ] Windows 10 1809 (Build 17763)
  • [ ] Windows 10 1903 (Build 18362)
  • [ ] Windows 10 1909 (Build 18363)
  • [ ] Windows 10 2004 (Build 19041)
  • [ ] Windows 10 20H2 (Build 19042)
  • [ ] Windows 10 21H1 (Build 19043)
  • [ ] Windows 11 21H2 (Build 22000)
  • [ ] Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • [ ] Windows 10, version 1809 (Build 17763)
  • [ ] Windows 10, version 1903 (Build 18362)
  • [ ] Windows 10, version 1909 (Build 18363)
  • [ ] Windows 10, version 2004 (Build 19041)
  • [ ] Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview Version 17.3.0 Preview 4.0

Device form factor

Desktop

Nuget packages

Microsoft.Toolkit.Uwp.UI.Controls V7.1.2 Microsoft-UI-Xaml V2.8

Additional context

Same issue on Microsft Xaml UI Github

Help us help you

No.

NGame1 avatar Jul 23 '22 19:07 NGame1

Hello NGame1, 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 Jul 23 '22 19:07 ghost

Can you share the reproduce of the issue. I have trouble opening the reproduce shared on Xaml UI GitHub

LalithaNadimpalli avatar Jul 26 '22 17:07 LalithaNadimpalli

To be honest, No. 😐 Not because I don't want Because it's not happening on a dummy project I made πŸ˜‘

But still, I have this issue with my main project. If you want I can provide you with a full build log. Is that helpful? But, I forget where was the option to set the output window log level.

NGame1 avatar Jul 26 '22 19:07 NGame1

@NGame1 Any additional information (like the build logs) is helpful, but the most helpful thing is a minimal repro.

Minimal repros allow us to diagnose the issue much faster and gives us assurance that it really is a bug with the Toolkit or Microsoft.UI.Xaml.

Arlodotexe avatar Jul 26 '22 21:07 Arlodotexe

@Arlodotexe Nice to meet you here. Unfortunately, I don't know why it doesn't happen on a new project. I can send you the full project privately. It's happening on the next Winsta version, and the source code is not really minimal.

NGame1 avatar Jul 26 '22 21:07 NGame1

From MagicAndre1981 in the linked issue:

this often happens with version mismatch of dependencies. Toolkit is using 2.7, so the version needs to be increase in toolkit. Raise an issue there

@LalithaNadimpalli Maybe this is part of the problem, we could try using this to repro the issue on our end.

Arlodotexe avatar Jul 26 '22 22:07 Arlodotexe

I can repro the issue on new project with my two computers. image image

Microsoft.NETCore.UniversalWindowsPlatform 6.2.14 Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.2.5

OneFingerCodingWarrior avatar Jul 27 '22 00:07 OneFingerCodingWarrior

Can you share the reproduce of the issue. I have trouble opening the reproduce shared on Xaml UI GitHub

It's just a simple new project with two nuget packages. I can download and open the project without any trouble. I upload the sample project again App3.zip

OneFingerCodingWarrior avatar Jul 27 '22 00:07 OneFingerCodingWarrior

I can repro the issue on new project with my two computers. image image

Microsoft.NETCore.UniversalWindowsPlatform 6.2.14 Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.2.5

your screenshot helped me out in finding a workaround. Add all these dependencies in all projects (Just in those you need not really all class libraries) Microsoft.NETCore.UniversalWindowsPlatform 6.2.14 Microsoft.Toolkit.Uwp.UI.Controls V7.1.2 Microsoft-UI-Xaml V2.8

Adding one of them to the main project and the other one to the other class library pr project is the main cause of this problem.

NGame1 avatar Jul 27 '22 14:07 NGame1

what happens if you add Microsoft-UI-Xaml 2.8 to the class lib?

MagicAndre1981 avatar Jul 27 '22 18:07 MagicAndre1981

what happens if you add Microsoft-UI-Xaml 2.8 to the class lib?

I think that should be documented somewhere. I didn't know that there's such dependency between these two NuGet packages. Even, it's not mentioned here in NuGet dependencies image

NGame1 avatar Jul 27 '22 19:07 NGame1

what happens if you add Microsoft-UI-Xaml 2.8 to the class lib?

I think that should be documented somewhere. I didn't know that there's such dependency between these two NuGet packages.

if it referenced it should appear as a dependency. Maybe nuspec generation bug ? Does adding it fixes it?

If not also try to add <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> to generate redirects so that references to 2.7 get redirected to 2.8 πŸ€”

MagicAndre1981 avatar Jul 27 '22 19:07 MagicAndre1981

what happens if you add Microsoft-UI-Xaml 2.8 to the class lib?

I think that should be documented somewhere. I didn't know that there's such dependency between these two NuGet packages.

if it referenced it should appear as a dependency. Maybe nuspec generation bug ? Does adding it fixes it?

If not also try to add <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> to generate redirects so that references to 2.7 get redirected to 2.8 πŸ€”

Yes, I added both NuGets to the Main project and class libraries, and the problem was fixed. @OneFingerCodingWarrior Can you test it and report if this workaround works for you too or not?

NGame1 avatar Jul 27 '22 19:07 NGame1

@MagicAndre1981 I checked the NuGet package also

image

The Microsoft-UI-Xaml >= 2.7.0 dependency didn't mention. Seems there's something going wrong with the build or NuGet package-making process.

NGame1 avatar Jul 27 '22 19:07 NGame1

this "PackageReference Include" is buggy when detecting dependencies so I install them on my own like in packages.config days to have full control over dependencies.

Nice to hear that you got it working

MagicAndre1981 avatar Jul 27 '22 20:07 MagicAndre1981

what happens if you add Microsoft-UI-Xaml 2.8 to the class lib?

I think that should be documented somewhere. I didn't know that there's such dependency between these two NuGet packages.

if it referenced it should appear as a dependency. Maybe nuspec generation bug ? Does adding it fixes it? If not also try to add <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> to generate redirects so that references to 2.7 get redirected to 2.8 πŸ€”

Yes, I added both NuGets to the Main project and class libraries, and the problem was fixed. @OneFingerCodingWarrior Can you test it and report if this workaround works for you too or not?

It works for me too, thanks

OneFingerCodingWarrior avatar Jul 27 '22 23:07 OneFingerCodingWarrior

@MagicAndre1981 I checked the NuGet package also The Microsoft-UI-Xaml >= 2.7.0 dependency didn't mention. Seems there's something going wrong with the build or NuGet package-making process.

Maybe WinUI 2.8.0 should responsible for the bug, because UI.Controls 7.1.2 is happy to work with WinUI 2.7.1。 Besides ,i don't want to install WinUI2.8 all over around

OneFingerCodingWarrior avatar Jul 28 '22 00:07 OneFingerCodingWarrior

Besides ,i don't want to install WinUI2.8 all over around

but you should do it to prevent such issues. I had similar issues in the past and now install the dependencies on my own to fully control them

MagicAndre1981 avatar Jul 29 '22 11:07 MagicAndre1981

what happens if you add Microsoft-UI-Xaml 2.8 to the class lib?

I think that should be documented somewhere. I didn't know that there's such dependency between these two NuGet packages. Even, it's not mentioned here in NuGet dependencies

The Controls package is a meta package, if you look at the individual packages within them, then you'll see WinUI listed:

image

michael-hawker avatar Aug 09 '22 16:08 michael-hawker

πŸ‘‹ After some investigation, I found that this issue is still present when the Community Toolkit is removed from the equation.

It can be reproduced using only class libraries and the Microsoft.UI.Xaml nuget package: image

After additional testing, the issue will go away if either of these conditions are met:

  • The Microsoft.UI.Xaml version used in the transitive dependency matches the version used in the referencing project (e.g., upgrading the Toolkit to 2.8)
  • Or, explicitly install the Microsoft.UI.Xaml package version you'd like to you in the project that references the problematic package/project with a reference to a lower version (the project that references the Toolkit, in this case).

Since this issue can be reproduced without the Toolkit, we'll hand this back to the WinUI team here.

We'll be able to update to WinUI 2.8 in the near future. For now, please install the specific version of Microsoft.UI.Xaml you'd like to use alongside the toolkit, if it differs.

Arlodotexe avatar Aug 24 '22 22:08 Arlodotexe