Dynamic Assembly

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?
 
G

Guest

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!
***************************
 
G

Guest

What is the correct way to "hide" the assembly. I set the file attribute to
hidden, but It still is loading the assembly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top