Dynamic Assembly

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have Assembly (A) which dynamically loads Asembly (B). Both Assemblies are
located in A's bin dir.

If I query, AppDomain.CurrentDomain.GetAssemblies

Returns an unloaded/unreferenced assembly (B) why? Assembly A does not
refernce any types in B. Is there a way to prevent this assembly from loading
on startup?
 
As long as the assembly is in the app path, it will be queried by your app,
even if it is never used. If you want to get around this, hide the assembly
and use Reflection to dynamically load it. If you want to go to the nth with
dynamic loading, you can store the assembly as code and gen it at runtime
with Reflection.Emit. The source will not show up as an unloaded assembly,
even if you smack it in the /bin folder.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
What is the correct way to "hide" the assembly. I set the file attribute to
hidden, but It still is loading the assembly.
 
Back
Top