473,468 Members | 1,349 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

loading "private" assemblies

Hello

I emply a "plug-in" architecture for a .NET Windows service. At OnStart, the service browses for DLL's in in sub-folders and loads them dyanamically using Assembly.LoadFrom()

The service executable is placed in its own folder with the assemblies required for its successful complilation. Each plugin is also stored in its own folder with the associated assemblies required for its succesful compilation ( the bin/release folder contents are copied to the run-time destination.

My questions is/are: If the service uses a common Assembly (such as My Utils.dll) that is also used by one or more plugins, will the plugin run-time code be pointed to the already loaded assembly or will the one in its physical location be loaded with it? Suppose they were built using the exact same version of the common assembly? And lastly, is it possible to specify that each plugin "use" the assembly in its own folder and not one that may have been loaded previously

Nov 16 '05 #1
4 1977
Hello

I will answer your last question first. It is possible to create multiple
application domains and specify a different path for probing assemblies for
each application domain. This leads to the your first question, if you do
this the assemblies will be loaded multiple times.

I don't know what will happen without application domains but i think that
multiple copies will be loaded too.

Best regards,
Sherif

"BillyMac" <wo************@noemail.noemail> wrote in message
news:1D**********************************@microsof t.com...
Hello -

I emply a "plug-in" architecture for a .NET Windows service. At OnStart, the service browses for DLL's in in sub-folders and loads them dyanamically
using Assembly.LoadFrom().
The service executable is placed in its own folder with the assemblies required for its successful complilation. Each plugin is also stored in its
own folder with the associated assemblies required for its succesful
compilation ( the bin/release folder contents are copied to the run-time
destination.)
My questions is/are: If the service uses a common Assembly (such as My Utils.dll) that is also used by one or more plugins, will the plugin
run-time code be pointed to the already loaded assembly or will the one in
its physical location be loaded with it? Suppose they were built using the
exact same version of the common assembly? And lastly, is it possible to
specify that each plugin "use" the assembly in its own folder and not one
that may have been loaded previously?

Nov 16 '05 #2
Thanks for Sherif's suggestion.

Hi,

As for the first question that if we manually use Assembly.LoadFrom load a
certain assembly and then call a class or type within that assembly, how
will the runtime search the assembly?

Based on my understanding, I think the actual behavior depend on the
whether the two assmblies are exactly the same one. (it's full name ,
version, culture, ....).

Since your plugin is loaded into your windows service's main AppDomain,
yes? When it call a class or type w(which is in the common ultiy assembly
you mentioned), the runtime will first check the memory to see whether the
class/ type is already existed. This require complete match, include ,
type/class name, namespace, the certain assemly's full name(the type/class
is contained). If match, the runtime will use the one in memory, otherwise,
it will search the certain required assembly as normal( by order , GAC,
private path...).
Also, I think a simple test on this is more valuable. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 16 '05 #3
Hi - ok, thanks for the info. I will use that to do further tests. You may close this post.

best regards,

Bill
Nov 16 '05 #4
Thanks Bill,

I've also done some tests and found that the actual things a far away from
what I've expected originally. In fact, the Assembly.Load ,
Assembly.LoadFrom are quite different . Anyway, I think the following blog
will be helpful to you.

#Choosing a Binding Context
http://blogs.msdn.com/suzcook/archiv.../29/57143.aspx
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 16 '05 #5

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

Similar topics

10
by: Scott Brady Drummonds | last post by:
Hi, everyone, I'm still learning Python as I develop a medium-sized project. From my previous experience with C++, I've burnt into my mind the notion of information hiding. I'm having trouble...
5
by: Steven Bethard | last post by:
Philippe C. Martin wrote: > class Debug_Stderr: > __m_text = '' > __m_log_text = None > __m_dbg = None > __m_refresh_count = 0 <rant> I don't see the benefit in 99.9% of cases for...
1
by: BillyMac | last post by:
Hello I emply a "plug-in" architecture for a .NET Windows service. At OnStart, the service browses for DLL's in in sub-folders and loads them dyanamically using Assembly.LoadFrom() The...
8
by: Etienne Boucher | last post by:
Nested classes are usualy objects made to only live in their parent object instance. In other words... public class Outter { public class Inner { } }
1
by: Edward | last post by:
I have trouble with some of the concepts of OOP, and am struggling currently with Private Shared Functions. I think I understand Private (not available outside the class). I think I understand...
3
by: Jordan Taylor | last post by:
I am confused about protected member functions and objects. Is there any particular advantage of declaring members protected?
0
by: Ratul | last post by:
Hi all! I'm writing a winforms test harness which lets me specify a subfolder from which to load a particular .net assembly dll. The idea is that there will be multiple subfolders, each having...
2
by: Joerg Toellner | last post by:
Dear Group, i develop an app with MSVC++ 2005 pro. My app should not use any installation. It's only a "packing out the zip and run it"-installation. So i use private assemblies with manifests...
4
by: Peter K | last post by:
Hi if I am developing a "class library" which contains some classes which should be exposed to the outside world, and other classes which I really would rather have "private" to my library...
0
by: Luis Zarrabeitia | last post by:
Quoting Joe Strout <joe@strout.net>: I'm sure your credentials are bigger than mine. But he is right. A lot of languages have ditched the "concept" of a static variable on a method (how do you...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.