Repository navigation
fix(maui): keep Microsoft.Maui.Controls out of the package dependencies - #135
Merged
Merged
Conversation
The explicit Microsoft.Maui.Controls reference that #108 added replaces the SDK's implicit one, which is private for libraries, so since 4.0.37 the package declares Controls 10.0.130. A consumer whose workload provides an older Controls then fails restore with NU1605. Marking both references private restores the 4.0.36 dependency list.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the scoped dependency-packaging changes.
No open issues 🎉
What changed in this PR
This PR adjusts dependency packaging for the MAUI facade and DotNetCore fallback, addressing the Microsoft.Maui.Controls downgrade error reported in #133. The separate Windows .pri packaging issue remains out of scope.
Changes:
- Adds
PrivateAssets="all"to both explicit Controls references, keeping them available for compilation but excluding them as direct package dependencies. - Retains the existing
10.0.130version override without changing public APIs or Bluetooth runtime logic.
| File | Description |
|---|---|
Bluetooth.Maui/Bluetooth.Maui.csproj |
Makes the facade’s Controls reference private. |
Bluetooth.Maui.Platforms.DotNetCore/Bluetooth.Maui.Platforms.DotNetCore.csproj |
Applies the same dependency isolation to the DotNetCore fallback. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Marks the two
Microsoft.Maui.Controlsreferences (Bluetooth.MauiandBluetooth.Maui.Platforms.DotNetCore) asPrivateAssets="all". Refs #133.Why
#108 added an explicit
Microsoft.Maui.Controlsreference (10.0.130). An explicit reference replaces the SDK's implicit one, which is private for libraries, so since 4.0.37 the package declaresMicrosoft.Maui.Controls (>= 10.0.130). A project that gets Controls only from its workload (10.0.110 with workload set 10.0.404) then fails restore with NU1605.Change Type
refa)Affected Areas
Bluetooth.Maui)Behavior And Compatibility
The package dependency list goes back to what 4.0.36 had.
Plugin.ExceptionListeners.Mauistill brings Controls transitively, as before.Platform Notes
Does not fix the
.prifiles that 4.0.37 and later ship, which cause APPX0002 on a Windows target built from a non-Windows host. That part of #133 stays open.Tests
dotnet pack Bluetooth.Maui -p:TargetFrameworks=net10.0before and after: the nuspec listsMicrosoft.Maui.Controls 10.0.130before and no longer lists it after; every other dependency is unchanged.Bluetooth.Maui.4.0.39-framinosona-pack-maui-controls-private.393): none of the five dependency groups (net10.0, Android, iOS, Mac Catalyst, Windows) listsMicrosoft.Maui.Controls; each still listsPlugin.ExceptionListeners.Maui 1.0.11. The two.prifiles are still in the Windows folder, as the summary says.