You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Xamarin.Android.Build.Tasks] add Condition in AutoImport.props (#9463)
One of the "gotchas" with `AutoImport.props`, is the file is imported
by literally *all* .NET projects. Even .NET 8 and .NET 9 Android
projects import their files on top of each other…
This means every `<ItemGroup>` needs a `Condition` that checks:
* Is this Android?
* Is this the expected .NET framework version?
`<ItemGroup>`s in `AutoImport.props` should have, something like:
<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '9.0')) ">
`$(EnableDefaultAndroidItems)` checks also work for some cases, but
[.NET MAUI turns this off in favor of their own wildcards][0].
[0]: https://github.com/dotnet/maui/blob/f269ef3de701043910c941bbbfcbdb7422cc245c/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.SingleProject.Before.targets#L10
0 commit comments