Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mohamed Zaki - 05 Jan 2006 14:54 GMT
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
Mike Miller - 06 Jan 2006 04:30 GMT
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

> Dear All,
>
[quoted text clipped - 5 lines]
> Regards,
> Mohamed
Mohamed Zaki - 06 Jan 2006 14:35 GMT
Thank you Mike, i tried the fully qualified name but the samething happened
:(

Regards,
Mohamed
> Your right - it should load the type correctly if assembly can be found.
> I
[quoted text clipped - 18 lines]
>> Regards,
>> Mohamed
Mike Miller - 06 Jan 2006 15:31 GMT
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.

> Thank you Mike, i tried the fully qualified name but the samething happened
> :(
[quoted text clipped - 23 lines]
> >> Regards,
> >> Mohamed
Mohamed Zaki - 07 Jan 2006 18:32 GMT
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.

>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
[quoted text clipped - 38 lines]
>> >> Regards,
>> >> Mohamed

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.