473,388 Members | 1,215 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Loading Assemblies

Hello all,

When dynamically loading classes through reflection using Assembly.LoadFrom
I have the following questions:

1) Once you load an assembly it doesn't appear you can unload it. If you
try to load an assembly multiple times does this cause any type of memory
issues?

2) If you load an assembly and later you try to load a newer version of the
same assembly, does .NET know it's the same assembly and if so, what happens?

3) Before you execute Assembly.LoadFrom should you check to see if the
assembly is already loaded to avoid loading it again and if so how?

Thanks in advance,
John F
Dec 20 '05 #1
1 1847
John F wrote:
Hello all,

When dynamically loading classes through reflection using Assembly.LoadFrom
I have the following questions:

1) Once you load an assembly it doesn't appear you can unload it. If you
try to load an assembly multiple times does this cause any type of memory
issues?

2) If you load an assembly and later you try to load a newer version of the
same assembly, does .NET know it's the same assembly and if so, what happens?

3) Before you execute Assembly.LoadFrom should you check to see if the
assembly is already loaded to avoid loading it again and if so how?

Thanks in advance,
John F


see http://tinyurl.com/2r7g4
1) Almost correct. You can only unload appdomains. What you can do is to
create a new AppDomain and load you assembly into it. However, you also
have to make sure to create your object inside the new domain using
AppDomain.CreateInstanceAndUnwrap(..).
I haven't had any issues calling LoadFrom multiple times.

2)If you have a string named assembly and the version is higher it will
get loaded.

3) see 1)

HTH,
Andy
--
To email me directly, please remove the *NO*SPAM* parts below:
*NO*SPAM*xmen40@*NO*SPAM*gmx.net
Dec 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Foehammer | last post by:
Hello, I'm trying to load an assembly dynamically using an app domain. This is a proof-of-concept for a larger project, so please excuse the lame class names. TestLib is the dll where all the...
9
by: Ender | last post by:
I have an application that I would like third party developers to be able to create Plug-ins that will be dynamically loaded into our application to extend functionality. I have utilized the...
2
by: Foehammer | last post by:
Hello, I'm trying to load an assembly dynamically using an app domain. This is a proof-of-concept for a larger project, so please excuse the lame class names. TestLib is the dll where all the...
1
by: =?Windows-1252?Q?Tor_B=E5dshaug?= | last post by:
BlankHi, I am having trouble loading assemblies from the database in my ASP.NET app. I have a default.aspx in my app that is served from a database via a custom virtual path provider. This works...
8
by: =?Utf-8?B?TWFyaw==?= | last post by:
We've got a wierd failure happening on just one machine. One part of our product uses a 3rd party search implementation (dtSearch). DtSearch has a native core (dten600.dll), late-bound, and a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.