0

I have:

Assembly A, B, C, D

Assembly A knows about B, C, and D

Assembly B knows about C and D

Assembly C knows about assembly D

Assembly A is the entry assembly.

Within no time, code from each of these assemblies will be executed. What I want to do is spot somehow from Assembly D (A library class) that a specific (I will hard code the name of it) Assembly B (different solutions of mine use different assemblies of type 'B')has at some point been used in the program stack. That way i can get a class from assembly B instantiated in assembly D without D 'officially' knowing about B. Shouldn't there be someplace that is recording which assemblies were loaded?

Assembly A is the entry assembly, Assembly C will be the calling assembly, and assembly D is the executing assembly. How would I find B, then?

Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90
  • 1
    You can get list of all loaded assemblies (http://stackoverflow.com/questions/383686/how-do-you-loop-through-currently-loaded-assemblies), but I'm not completely sure what exactly you are trying to do... It feel you trying to reinvent some sort of plugin system, but maybe not. – Alexei Levenkov Nov 28 '14 at 02:51
  • Create another assembly, create wrapper classes of all the classes of A,B,C,D. Use that assembly as a relay point of all your calls, record every action from there *prolly a base class that has a static list of string that has all the calls stored* – DevEstacion Nov 28 '14 at 02:54
  • Lol, it's gross but it's going to be especially convenient. I can get a lot of common code out of Assembly type A into common assembly C if I can know which assembly B is being used. – Isaac Bolinger Nov 28 '14 at 02:55

1 Answers1

1

I called:

AppDomain.CurrentDomain.GetAssemblies()

then I looped through them.

Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90