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

[MauiEmbedding] MauiCommunityToolkit - Nugget Package manager exception error. #744

Closed
Darsh0307 opened this issue May 2, 2024 · 5 comments
Assignees
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@Darsh0307
Copy link

Darsh0307 commented May 2, 2024

Current behavior

There is an exception showing when we are trying to add CommunityToolkit.MVVM as nuget package manager. But when we are adding it, there is an exception showing. Its showing me an error message to downgrade the pacakge. At the same time the pacakages are on 8.0.14.

image

CACHE https://api.nuget.org/v3-vulnerabilities/2024.04.25.01.10.39/vulnerability.base.json
  CACHE https://api.nuget.org/v3-vulnerabilities/2024.04.25.01.10.39/2024.04.29.13.11.05/vulnerability.update.json
NU1605: Warning As Error: Detected package downgrade: Microsoft.Maui.Controls from 8.0.14 to 8.0.7. Reference the package directly from the project to select a different version. 
 MauiEmbeddingApp -> MauiEmbeddingApp.MauiControls -> Microsoft.Maui.Controls (>= 8.0.14) 
 MauiEmbeddingApp -> Microsoft.Maui.Controls (>= 8.0.7)
NU1605: Warning As Error: Detected package downgrade: Microsoft.Maui.Controls.Compatibility from 8.0.14 to 8.0.7. Reference the package directly from the project to select a different version. 
 MauiEmbeddingApp -> MauiEmbeddingApp.MauiControls -> Microsoft.Maui.Controls.Compatibility (>= 8.0.14) 
 MauiEmbeddingApp -> Microsoft.Maui.Controls.Compatibility (>= 8.0.7)
NU1605: Warning As Error: Detected package downgrade: Microsoft.Maui.Graphics from 8.0.14 to 8.0.7. Reference the package directly from the project to select a different version. 
 MauiEmbeddingApp -> MauiEmbeddingApp.MauiControls -> CommunityToolkit.Maui 8.0.1 -> CommunityToolkit.Maui.Core 8.0.1 -> Microsoft.Maui.Core 8.0.14 -> Microsoft.Maui.Graphics (>= 8.0.14) 
 MauiEmbeddingApp -> Microsoft.Maui.Graphics (>= 8.0.7)
NU1605: Warning As Error: Detected package downgrade: Microsoft.Maui.Graphics from 8.0.14 to 8.0.7. Reference the package directly from the project to select a different version. 
 MauiEmbeddingApp -> MauiEmbeddingApp.MauiControls -> CommunityToolkit.Maui 8.0.1 -> CommunityToolkit.Maui.Core 8.0.1 -> Microsoft.Maui.Essentials 8.0.14 -> Microsoft.Maui.Graphics (>= 8.0.14) 
 MauiEmbeddingApp -> Microsoft.Maui.Graphics (>= 8.0.7)
Package restore failed. Rolling back package changes for 'MauiEmbeddingApp'.
Time Elapsed: 00:00:00.6691913

Expected behavior

We should be able to add the nuget package easily in the project.

Templates Version

  1. "Uno.Sdk": "5.2.108"
    
  2. " Uno.templates" : 5.2.30

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

  1. Create a MauiEmbeddingApp.
  2. Follow all the steps ,
  3. When you are in step 5 of Adding Drawing View , it is clearly mentioned that we have to add CommunityToolkit.MVVM in MauiEmbeddingApp \
  4. Try Adding the Nuget package manager

MauiEmbeddingApp.zip
MauiEmbeddingApp_Debug_AnyCPU_net8.0-windows10.0.19041_Build_2024-04-30T14_25_55.7227510-04_00.zip

@Darsh0307 Darsh0307 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels May 2, 2024
@Darsh0307 Darsh0307 changed the title [MauiCommunityToolkit] [MauiCommunityToolkit] Nugget Package manager exception error. May 2, 2024
@agneszitte
Copy link
Contributor

fyi @dansiegel, @jeromelaban
Ask @Darsh0307 for more info as needed

@nickrandolph
Copy link
Contributor

@Darsh0307 the guide should be updated to use the Mvvm feature to import CommunityToolkit.Mvvm
@dansiegel should the guide be updated to set the MauiVersion explicitly?

@nickrandolph nickrandolph changed the title [MauiCommunityToolkit] Nugget Package manager exception error. [MauiEmbedding] MauiCommunityToolkit - Nugget Package manager exception error. May 7, 2024
@dansiegel
Copy link
Contributor

@nickrandolph MauiVersion is set by the SDK you have installed so this should auto increment for the developer over time which is why the template uses $(MauiVersion) instead of an explicit version.

@agneszitte
Copy link
Contributor

fyi @vatsashah45 since you are currently updating the mauiembedding samples to single project.
Make sure to keep the documentation properly updated at the same time you are working on migrating the sample please

@jeromelaban jeromelaban transferred this issue from unoplatform/uno.extensions Jun 12, 2024
@jeromelaban
Copy link
Member

jeromelaban commented Jun 12, 2024

This issue is now fixed with the auto upgrade of packages from the uno.sdk. This is a generally standard error that can happen when dependencies get updated to later versions than the ones we provide in the template. Bumping Microsoft.Maui.* in Direcctory.Build.props is the way to handle this.

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/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

6 participants