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
Context: #5040
In trying to enable our F# MSBuild tests, one fails with:
GenerateCompressedAssembliesNativeSourceFiles
Xamarin.Android.Common.targets(1933,3): error XAGCANSF7004: System.ArgumentException: An item with the same key has already been added. Key: [FSharp.Core.resources.dll, Xamarin.Android.Tasks.CompressedAssemblyInfo]
at System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
at System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
at Xamarin.Android.Tasks.GenerateCompressedAssembliesNativeSourceFiles.GenerateCompressedAssemblySources()
at Xamarin.Android.Tasks.GenerateCompressedAssembliesNativeSourceFiles.RunTask()
at Xamarin.Android.Tasks.AndroidTask.Execute()
Looking at some of the item groups earlier:
C:\src\xamarin-android\packages\xamarin.android.fsharp.resourceprovider\1.0.1\lib\monoandroid81\Xamarin.Android.FSharp.ResourceProvider.Runtime.dll
...
DestinationSubPath = Xamarin.Android.FSharp.ResourceProvider.Runtime.dll
...
C:\src\xamarin-android\packages\fsharp.core\4.7.2\lib\netstandard2.0\cs\FSharp.Core.resources.dll
...
DestinationSubDirectory = cs\
DestinationSubPath = cs\FSharp.Core.resources.dll
...
C:\src\xamarin-android\packages\fsharp.core\4.7.2\lib\netstandard2.0\de\FSharp.Core.resources.dll
...
DestinationSubDirectory = de\
DestinationSubPath = de\FSharp.Core.resources.dll
...
Two instances of `FSharp.Core.resources.dll` is causing the above
exception. Should we be using the `%(DestinationSubDirectory)` and
`%(DestinationSubPath)` item metadata?
Currently, we have some behavior for architecture-specific .NET
assemblies:
* `%(AbiDirectory)` is set for x86, armeabi-v7a, etc.
* `%(IntermediateLinkerOutput)` is set to a full path taking
`%(AbiDirectory)` into account.
To clean things up here, we should just use
`%(DestinationSubDirectory)` coming from dotnet/sdk and
`%(DestinationSubPath)` and remove the item data that we invented.
Other changes:
* Usage of `%(AbiDirectory)` can use `%(DestinationSubDirectory)` or
`%(DestinationSubPath)` where appropriate.
* Any usage of `%(IntermediateLinkerOutput)` can use
`$(MonoAndroidIntermediateAssemblyDir)%(DestinationSubPath)`
instead.
* The `<ResolveAssemblies/>` (legacy) and `<ProcessAssemblies/>`
MSBuild tasks no longer need the `IntermediateAssemblyDirectory`
property.
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
0 commit comments