I have an assembly fully populated with classes that implement interfaces in another assembly. For instance:
Main Assembly (Reference to both assemblies) Shared Assembly -----IModule Class Assembly (Reference to shared assembly) -----unknownType : IModule -----unknownType2 : IModule
The main assembly is not directly related to any of the assembly types of the class. I am looking for the following types:
// Load all referenced assemblies: Assembly.GetExecutingAssembly().GetReferencedAssemblies() .Except(AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetName())) .Distinct() .ToList() .ForEach(act => Assembly.Load(act)); // Find all instances of IModule in loaded assemblies: var modules = from asm in AppDomain.CurrentDomain.GetAssemblies() from provider in asm.GetTypes() where typeof(IModule).IsAssignableFrom(provider) ...instantiate type etc...
If I have a reference to only an arbitrary type in the assembly of classes, then it appears in GetReferencedAssemblies, loads and returns correctly - but as soon as I delete the reference to the type, it is not transferred to the assembly directory or displayed as a reference assembly, which leads to failure downloads.
Is there a way to get VS to include this assembly in the output directory? The main application should not know any of the types in the class assembly.
source share