Skip to content

Commit

Permalink
Add implicit package reference for Compat (#13427)
Browse files Browse the repository at this point in the history
Ultimately we want this to be an implicit reference which is not included by default and opt-in, however visual studio's Live Visual tree currently depends on the assembly existing and being loaded so we cannot yet remove it.

The default property assignment can be removed once VS is ready for this.
  • Loading branch information
Redth authored and mattleibow committed Mar 31, 2023
1 parent 9d48fc0 commit 86781cd
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<MauiWorkloadVersion>@VERSION@</MauiWorkloadVersion>
<MauiWorkloadTargetFramework>@TFM@</MauiWorkloadTargetFramework>
<MauiVersion Condition=" '$(MauiVersion)' == '' ">$(MauiWorkloadVersion)</MauiVersion>

<!--
Indicates that the Microsoft.Maui.Controls.Compatibility package should be implicitly
referenced. This will eventually switch to false by default and become opt, in,
however Visual Studio currently depends on this assembly being loaded for Live Visual Tree.
-->
<UseMauiCompat Condition=" '$(UseMauiCompat)' == '' and '$(UseMaui)' == 'true' ">true</UseMauiCompat>
</PropertyGroup>

<!--
Expand Down Expand Up @@ -35,6 +42,8 @@
<_MauiImplicitPackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)">
<PrivateAssets Condition=" '$(OutputType)' == 'Library' and '$(AndroidApplication)' != 'true' ">all</PrivateAssets>
</_MauiImplicitPackageReference>
</ItemGroup>
<ItemGroup Condition=" '$(UseMaui)' == 'true' and '$(UseMauiCompat)' == 'true' ">
<_MauiImplicitPackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)">
<PrivateAssets Condition=" '$(OutputType)' == 'Library' and '$(AndroidApplication)' != 'true' ">all</PrivateAssets>
</_MauiImplicitPackageReference>
Expand Down

0 comments on commit 86781cd

Please sign in to comment.