Skip to content

Commit 4a3cb4d

Browse files
committed
[Xamarin.Android.Build.Tasks] PackageReference and AndroidUseLatestPlatformSdk do not work together
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59534 When using `PackageReference` with our system it run before `_SetLatestTargetFrameworkVersion`. As a result it always uses a `$(TargetFrameworkVersion)` of v2.3 or what ever the user defined in the project manually. So we need to make sure that `_SetLatestTargetFrameworkVersion` runs as part of the `PackageReference` target chain. Fortunately that chain is run as part of `ResolveAssemblyReferencesDependsOn`. So we just need to make sure that our target in run as part of that target chain in order to fix this issue.
1 parent 47f370f commit 4a3cb4d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
140140
*******************************************
141141
-->
142142

143+
<PropertyGroup>
144+
<ResolveAssemblyReferencesDependsOn>
145+
_SetLatestTargetFrameworkVersion;
146+
$(ResolveAssemblyReferencesDependsOn)
147+
</ResolveAssemblyReferencesDependsOn>
148+
</PropertyGroup>
149+
143150
<PropertyGroup>
144151
<GetReferenceAssemblyPathsDependsOn>
145152
_SetLatestTargetFrameworkVersion;

0 commit comments

Comments
 (0)