COM interop. When you reference a COM assembly it will actually generate a COM interop assembly to marshal between .NET and COM. If you have two assemblies both referencing the same COM assembly you may actually have two identically generated interop assemblies.
One solution, and frankly better design in general, would be to create interfaces in one of the two assemblies (or a shared 3rd assembly) which expose the features you want to make public and instead of using or consuming COM Types use these interfaces instead.
namespace Project1
{
public interface IApplication
{
// application members here...
}
public class Class1
{
public static IApplication GetApp()
{
return new ExcelApplication(new Microsoft.Office.Interop.Excel.Application());
}
private class ExcelApplication : IApplication
{
public ExcelApplication(Microsoft.Office.Interop.Excel.Application app)
{
this.app = app;
}
// implement IApplication here...
}
}
}