Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uno project with Maui embedding using different versions of Microsoft.Maui.Controls and Microsoft.Maui.Controls.Compatibility than the xxx.MauiControls project #18259

Open
mobynet1 opened this issue Sep 19, 2024 · 6 comments
Labels
kind/bug Something isn't working triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@mobynet1
Copy link

mobynet1 commented Sep 19, 2024

Current behavior

OK... I have my dev environment put back together on a different machine and I simply created a new Uno project that included Maui control embedding. I had indicated in an earlier issue or discussion that I tried this several weeks ago and found the new solution with no modifications will not build. (I do have all of the NuGet issues resolved...). The main project will not build due to compatibility issues with the two Microsoft Maui packages mentioned in the title. Specifically, the issue is this:

NU1605	Warning As Error: Detected package downgrade: Microsoft.Maui.Controls from 8.0.82 to 8.0.71. Reference the package directly from the project to select a different version. 
 UnoApp1 -> UnoApp1.MauiControls -> Microsoft.Maui.Controls (>= 8.0.82) 
 UnoApp1 -> Microsoft.Maui.Controls (>= 8.0.71)	UnoApp1 (net8.0-android), UnoApp1 (net8.0-browserwasm), UnoApp1 (net8.0-desktop), UnoApp1 (net8.0-ios), UnoApp1 (net8.0-maccatalyst), UnoApp1 (net8.0-windows10.0.19041)

and

NU1605	Warning As Error: Detected package downgrade: Microsoft.Maui.Controls.Compatibility from 8.0.82 to 8.0.71. Reference the package directly from the project to select a different version. 
 UnoApp1 -> UnoApp1.MauiControls -> Microsoft.Maui.Controls.Compatibility (>= 8.0.82) 
 UnoApp1 -> Microsoft.Maui.Controls.Compatibility (>= 8.0.71)	UnoApp1 (net8.0-android), UnoApp1 (net8.0-browserwasm), UnoApp1 (net8.0-desktop), UnoApp1 (net8.0-ios), UnoApp1 (net8.0-maccatalyst), UnoApp1 (net8.0-windows10.0.19041)

When you expand this package in the NuGet Package Manager, I see this:

image

I would uninstall them and re-install them, but I cannot do so because doing anything with these two packages is "blocked by project"

image

Mind you, this is a brand new solution created in Visual Studio 2022, v17.11.4 (latest) without any modifications.

Also, the package System.Formats.Asn1, v8.0.0, has been marked as 'Vulnerable' and will not update to the correct version of 8.0.1. When I try to update the package in the Package Manager, it simply will not allow me to move it to the stable version.

The issues I have been reporting about new projects not building was precipitated by me trying to get Maui control embedding working. Because Codium AI had me do something weird several weeks ago regarding a different NuGet package issue totally hosed my environment up. Hence, moving to a new dev environment... But, now I am back to square one with not being able to build a project with Telerik Maui controls.

I know you guys are very responsive and I deeply appreciate your time, but I HAVE GOT to get this demo done and this issue is blocking me.

Expected behavior

Having it build would be great!

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

I wish there was one!

Works on UWP/WinUI

None

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

No response

Affected platforms

Windows (WinAppSDK)

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

I really need a working solution in the next day or so...

@mobynet1 mobynet1 added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Sep 19, 2024
@mobynet1
Copy link
Author

When I was in college taking calculus, there was the concept of the asymptotic line where the asymptote approaches infinitely but never crosses the line. That is this project to me. And, like according to Newton’s Third Law of Motion, which states that for every action, there is an equal and opposite reaction. This means that if you push against an object, the object pushes back with an equal force in the opposite direction. I am nearing a demo deadline and the closer I get, the harder things get. I should be retired by now but the forces of life are continually and forcefully pushing back on me...

I just need a break. Is there any update on this?

@MartinZikmund
Copy link
Member

The NuGet versions are controlled by Uno.Sdk itself - you can see the README on NuGet.org for the given Uno.Sdk version to understand which versions those are - https://www.nuget.org/packages/Uno.Sdk/5.4.0-dev.145#readme-body-tab

image

To overwrite this version, you can use MSBuild property with the given name and put it in Directory.Build.props, e.g.:

<PropertyGroup>
	...
	<MauiVersion>8.0.82</MauiVersion>
</PropertyGroup>

@MartinZikmund MartinZikmund added triage/needs-information Indicates an issue needs more information in order to work on it. and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Sep 23, 2024
@mobynet1
Copy link
Author

mobynet1 commented Sep 23, 2024

@MartinZikmund Thanks for your reply. This is good to know as I was trying to see how I could "config" my way out of this jam. So, I will take a look at that, but......

The freshly created solution using the online wizard produces a project that does not build. The Uno project Maui package versions are out of sync with the MauiControls project Maui packages. That was more my point in creating this issue, but I also did need the info you provided, so thanks for that!!

@mobynet1
Copy link
Author

mobynet1 commented Sep 25, 2024

@MartinZikmund There must be something I am missing. I added the MauiVersion element to my Directory.Build.props file (in the main project) and it did not force a change of the Maui version from 8.0.71 to 8.0.82 to match the versions that are in the xxx.MauiControls project.

    <NoWarn>$(NoWarn);NU1507;NETSDK1201;PRI257</NoWarn>
	
    <MauiVersion>8.0.82</MauiVersion>

At the same time, I updated my global.json file to indicate the Uno.Sdk version should be 5.4.5 which appears to be the latest SDK version. I must have to do something else, but what that is escapes me... What else should I try?

@mobynet1
Copy link
Author

Since I saw activity on the SDK, I decided to create yet another new solution and this time, it appears as though all of the Maui packages are loading properly. I'm going to keep an eye out on this one. I would still like to know why my previous comment didn't fix the issue...

@mobynet1
Copy link
Author

After updating the various SDKs and making the suggested changes, I was able to get the new application to build and run, although the Maui components did not show up. On a lark, I decided to once again create a new project and this time, even without any edits, the app launched and the Maui components displayed! Whew! When I looked at various files in this new project, I could tell that you guys had made some changes to things like the project and build files. I am thankful you did this! I am off and running now! Now, hopefully I can merge the code from my Maui-less app into this new project and still have everything work! I am going to leave this issue open until I have had time to test all the moving parts. In the meantime, thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants