I have created an assembly package using the tool ILMerge.
There is an assembly (lets call it A
) which is part of that packaged assembly which is going to be used by a other assembly, which is not included in the package (lets call it B
).
Now what I want to do is create a project which references both, the packed assembly and B
. Now I would like to do that:
public void Foo()
{
var obj = new Bar(); // Bar is part of `A`
var someFactory = new Factory(); // is part of `B`
someFactory.DoSomething(obj);
// compiler error here, which says I need to reference the assembly which contains `Bar`
}
I made sure that the assembly A
, which was included into the package and the one referenced by B
are the same.
Is there something I`m missing here?
Update with more Context
We have a datamodel project which has lots of dependent projects (I know this is bad in the first place, but its legacy code :-( ) So I would like to merge all these assemblies to one in order to use that data model assembly more easily in multiple solutions.