question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MAUI Dependencies cause issues when updating the MAUI workload with 3rd party dependencies

See original GitHub issue

Description

The issue was first reported by @rdavisau in the SponsorConnect Discord. After updating to MAUI SR1 a project with 3rd party dependencies built against MAUI GA caused a NuGet Dependency downgrade that broke the build. This seems to be caused by a NuGet dependency which is added to libraries which have UseMaui. As discussed with @Redth these dependencies probably shouldn’t be added to NuGet packages built against MAUI

image

NuGet Dependencies that are automatically added

image

Resulting error after updating to SR1

Reproduction: https://github.com/rdavisau/maybe-update-maui

Steps to Reproduce

  1. Create a MAUI app
  2. Add Community Packages that were built against the MAUI GA
  3. Use SR1

Version with bug

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS, Other (Tizen, Linux, etc. not supported by Microsoft directly)

Affected platform versions

all

Did you find any workaround?

No response

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:27 (25 by maintainers)

github_iconTop GitHub Comments

3reactions
Redthcommented, Jun 15, 2022

For now here’s a workaround you can use in your library projects to rebuild them without containing the dependency. Add this to your library project which you are packaging into a nuget:

<ItemGroup>
	<PackageReference Include="Microsoft.Maui.Dependencies" Version="$(MauiVersion)">
		<PrivateAssets>All</PrivateAssets>
	</PackageReference>
	<PackageReference Include="Microsoft.Maui.Extensions" Version="$(MauiVersion)">
		<PrivateAssets>All</PrivateAssets>
	</PackageReference>
</ItemGroup>
2reactions
Redthcommented, Jun 15, 2022

What seems to be happening here is the Microsoft.Maui.Dependencies and Microsoft.Maui.Extensions are flowing through in dotnet pack of libraries using UseMaui when they really should not be.

Looking into how we can 1) work around this, and 2) fix this behaviour going forward…

Read more comments on GitHub >

github_iconTop Results From Across the Web

MAUI Dependency error - Microsoft Q&A
Hi, I'm trying to create a new project in MAUI but I get dependency errors. I have VS Community installed and updated with...
Read more >
Telerik UI for .NET MAUI pkg & MAUI Workload Mismatch ...
NET MAUI pkg still has the dependency on MAUI Workload, ... We then release Telerik UI for MAUI v2 with the updated WinAppSDK...
Read more >
Is Maui dead on arrival? : r/dotnet
I always found 3rd party controls more trouble than they're worth. But I've never worked at a company with demanding UI standards.
Read more >
How can i resolve .net MAUI dependencies errors?
NET MAUI. But after creating a new Project, i have dependencies errors, especifically Nuget packages... Click to See Image. I did try to...
Read more >
Is Your Xamarin.Forms Project Ready For Migration To MAUI?
You will need to update via command line to install the MAUI workload. You can find the guide here. Once your new project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found