I am trying to build a fairly large solution and one static class with some extension functions gives me a bit of a headache. I will simplify the code a lot, basically it boils down to following:
There is a
public static typeP Convert(this typeD d, typeA a, typeB b) {
return somethingOfTypeP;
}
and there is a
public static IList<typeP> Convert(this IList<typeD> d, IList<typeA> a, IList<typeB> b) {
return d.Select(x => x.Convert(a.FirstOrDefault(), b.FirstOrDefault()).ToList();
}
So, practically an extension method that does something and another one that extends the idea to a list.
typeA and typeB have a great-grandfather which sits in a package which is not referenced by this project, but obviously is referenced where it is immediately needed (in its children's project).
Everything works great on all of my colleagues' machines, everything builds and the "grandfather's dll" is nicely copied to this project's binary folder upon build - everything's awesome. But on my machine, I get
The type GreatGrandfather is defined in an assembly that is not referenced.
You must add a reference to assembly Greatgrandfathers.assembly, version=... etc.
..on the call to the first Convert, in the Select(lambdaExpression).
So I am really confused by this, actually. If the types are nicely resolved in one place (definition of both Convert methods), why is there a problem with the call from x => x.Convert(...)? Also, why is it only a problem on my computer and nowhere else? I don't see anything that is radically different, same target frameworks, same packages that get pulled down (nuget from a local package source). If I do add the package with Grandfathers.assembly, everything builds and works, but if I make this change, I need to understand why I need it... Any ideas, anyone?