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 / CLR / November 2005

Tip: Looking for answers? Try searching our database.

Loading Assembly without know its physical location.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
orianavim@gmail.com - 28 Oct 2005 22:54 GMT
Hi,

I'm trying to create a map of my project reference while looping
through my dll references.

This is what I'm doing:

1. I'm able to load my root assembly using "Assembly.LoadFile"
2. get all the references AssemblyNames using
"assembly.GetReferencedAssemblies();"
3. Trying to load each one of those references: all the reference which
are in the GAC are loaded, and all the others (which are my other
project dll's) cannot be located. Is there anyway to load those
dll's without knowing their location?

My second question. If my project reference dll's without copy them
localy, how can I find their physical file? Any idea?

I already tried all the other function given in the Assembly class,
none of them worked.

I'm using VS 2005.

Thanks.
EP - 22 Nov 2005 14:30 GMT
Hello orianavim@gmail.com,

> 1. I'm able to load my root assembly using "Assembly.LoadFile"
> 2. get all the references AssemblyNames using
[quoted text clipped - 4 lines]
> project dll's) cannot be located. Is there anyway to load those
> dll's without knowing their location?

When the framework needs an assembly, it will look for it in certain places
(GAC, download cache, app dir, etc.)  If it's not in one of those places,
and you don't know where it is, it would be pretty hard to load.
You might be talking about finding it at runtime.  You can load the assembly
by assemblystring, and attach to the AssemblyResolve event.  When the framework
can't find an assembly, it will ask your callback to locate it.  

> My second question. If my project reference dll's without copy them
> localy, how can I find their physical file? Any idea?

Select one of the references in VS and look at the properties window, the
"Path" property should show you the physical location.

> I already tried all the other function given in the Assembly class,
> none of them worked.
>
> I'm using VS 2005.
>
> Thanks.

Rate this thread:







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.