I have a dotnet standard library that uses speckle objects 3.4.2 as a dependency.
I have a net8.0 testing application that tests that library, and another 8.0 docker image that uses the library.
When I call any Speckle functionality from within either library, I get the message
System.MissingMethodException : Method not found: 'System.Collections.Generic.IEnumerable`1<!!0> Speckle.Sdk.Dependencies.EnumerableExtensions.DistinctBy(System.Collections.Generic.IEnumerable`1<!!0>, System.Func`2<!!0,!!1>)'.
I’ve tracked it down to here:
[speckle-sharp-sdk/src/Speckle.Sdk.Dependencies/Collections.cs](https://github.com/specklesystems/speckle-sharp-sdk/blob/05f73539251de803f21f9d2dd8fd27019e2c4e73/src/Speckle.Sdk.Dependencies/Collections.cs#L26-L43)
Lines 26 to 43 in [05f7353](https://github.com/specklesystems/speckle-sharp-sdk/commit/05f73539251de803f21f9d2dd8fd27019e2c4e73)
#if NETSTANDARD2_0
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector
)
{
var keys = new HashSet<TKey>();
foreach (var element in source)
{
if (keys.Contains(keySelector(element)))
{
continue;
}
keys.Add(keySelector(element));
yield return element;
}
}
#endif
Updating the standard library to dotnet 8 fixes the issue but that also means cutting off a huge swathe of our 2.0 libraries from being able to use the Speckle functionality we’ve been building.