473,568 Members | 2,905 Online
Bytes | Software Development & Data Engineering Community
+ 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.LoadFr om()

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 2001
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.noemai l> wrote in message
news:1D******** *************** ***********@mic rosoft.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.LoadFr om().
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.LoadFr om 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.LoadFr om 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
3305
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 understanding to what extent I should follow this policy in my Python code so I thought I'd ask the group. I read from a previous post that to...
5
2005
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 making class variables
1
362
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 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...
8
2822
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
23141
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 Shared (available without having to instantiate a class). So how could a Private Shared Function be called? Why give it this particular scope?
3
6695
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
1715
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 this dll. To ensure that there are no conflicts with similarly named assembly dll files, I'm am trying to load a subdirectory's dll into its own...
2
4022
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 and DLLs in the app directory itself. All works fine with MSVC2005 Pro PRE SP1. I packed into my app-zip also the Microsoft.VC80.CRT.manifest...
4
1865
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 (helper/utility classes), how do I achieve this? Obviously public classes can just be declared "public". But how do I make classes available only to...
0
3987
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 parse that sentence, btw?) in favour of using encapsulation. Of the top of my head, there is Java, C# and Python, and I think even PHP and Perl....
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.