Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have a program that loads an assembly into an AppDomain. The part I don't get (yet) is how do I reference any of the classes inside the assembly that was loaded at run-time? Inside this dll is a form that I want to open. Anytime I try to call it from my program I can't because it is not declared. Should I declare it somewhere? Whats the best way to handle this?

Codeless

...it just goes on and on.

  • *Experts*
Posted

If you know the name of the object you can create an instance of it using Reflection:

'Get the DLL
Dim dll As Reflection.Assembly = Reflection.Assembly.LoadFrom("dll path")
'Create an instance of the specified object
Dim yourobject As Object = dll.CreateInstance("type name")

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...