Load Assembly Type.GetType("Class,Assembly")


M

Mohamed Zaki

Dear All,

How Can i load an assembly located in the bin folder of an asp.net
application using the Type, ie.e
Type type=Type.GetType("Namespace.class,assembly"), i used the previous
command and it it returns null, is there any clues for what i'm missing.

Regards,
Mohamed
 
Ad

Advertisements

G

Guest

Your right - it should load the type correctly if assembly can be found. I
find that sometimes you need to use the fully qualified name of the assembly
such as:

System.Windows.Forms.Form, System.Windows.Forms, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089

This is especially true if mutiple versions exists or the reference is
ambiguous. Hope that helps.
Mike
 
M

Mohamed Zaki

Thank you Mike, i tried the fully qualified name but the samething happened
:(

Regards,
Mohamed
 
G

Guest

I would first try making sure the assembly is loaded. You try to load the
assembly explicitly using Assembly.Load("full assembly name"). If that is
not working you debug the assembly load problem using the information in this
article:

http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx

Once we know for sure the assembly is loaded, it should be easier to
troubleshoot.
 
Ad

Advertisements

M

Mohamed Zaki

Hi Mike,

When i load the assembly using system.reflection.assembly.load
then from the returned assembly use gettype, it work fine, my questions now,
ain't Type.GetType load the assembly directly if it placed inside the bin
folder ?

Appreciating your help so much.
 

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

Similar Threads


Top