473,326 Members | 2,126 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,326 software developers and data experts.

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 1971
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.