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 / June 2004

Tip: Looking for answers? Try searching our database.

Assembly Loader Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stelios - 17 Jun 2004 13:37 GMT
In microsoft articules the say that Assembly load method is the one that is
used by the clr to locate and load an assembly. They discriped in create
details all the steps involved in that process.

My question is the following  i have and assembly that is located under
c:/Test/assembly.dll
and i have an application that is running under
c:/Myapplicatio/MyApplication.exe.
I whant to use Assembly.load in order to load the assembly.dll a.d i have
use tha AppDomain class to chenge the APPBASE property which i has expecting
to retirect CLR to the directory of assembly.dll. This is not working and i
run out of ideas here. Can anyone help please.

The code i have used is listed below:

AppDomain currentDomain = AppDomain.CurrentDomain;

currentDomain.SetupInformation.ApplicationBase = @"C:/Test/";

Assembly Asm1 = currentDomain.Load("assembly.dll");
Justin Rogers - 19 Jun 2004 07:10 GMT
Once the AppDomain is created and has performed it's first bind you
can't set that property any more.  You can set private paths, but they
have to point into some directory underneath ApplicationBase.

Also note that SetupInformation will always return a clone of the actual
AppDomainSetup object, and never return the actual one being used.

Signature

Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

> In microsoft articules the say that Assembly load method is the one that is
> used by the clr to locate and load an assembly. They discriped in create
[quoted text clipped - 16 lines]
>
> Assembly Asm1 = currentDomain.Load("assembly.dll");
Roger Tan [MSFT] - 22 Jun 2004 20:46 GMT
To further explain what Justin described, you will need to create a new
AppDomain (and not use the current appdomain). You can instantiate a new
AppDomainSetup object, and set the AppBase appropriately. Then, create a
new AppDomain with the new AppDomainSetup object, and things should work
fine.

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.