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

Dynamic Assembly Loading Strategy

What is the best strategy for dynamic loading private assemblies in asp.net?
I understand, and have confirmed, that any dll placed in the app's /bin dir
will get loaded on startup. This is not desirable.

I have a web service that, based on an input parameter, dynamically loads A,
B or C library. I also understand that an separate AppDomain is needed to
explicitly unload the Assembly. No other apps will use these assemblies.

Do I need an IPlugin Interface type architecture to correctly achieve this?

Where should I put the "sub" assemblies?

Do I use Load, LoadFrom or LoadFile?

Regards,
Brian
Nov 19 '05 #1
4 2465
Your first statement is not true. Assemblies are loaded the first time a
type is loaded from the assembly.

HTH,

bill
"BrianS" <Br****@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
What is the best strategy for dynamic loading private assemblies in asp.net? I understand, and have confirmed, that any dll placed in the app's /bin dir will get loaded on startup. This is not desirable.

I have a web service that, based on an input parameter, dynamically loads A, B or C library. I also understand that an separate AppDomain is needed to
explicitly unload the Assembly. No other apps will use these assemblies.

Do I need an IPlugin Interface type architecture to correctly achieve this?
Where should I put the "sub" assemblies?

Do I use Load, LoadFrom or LoadFile?

Regards,
Brian

Nov 19 '05 #2
This is true for Windows forms, but not Asp.Net.

Throw any dll in yopur apps /bin dir, then on startup query the assembly
with reflection on startup:

Dim myAssemblies() As [Assembly] = AppDomain.CurrentDomain.GetAssemblies

asp.net always loads assemblies because of machine.config setting <add
assembly="*" />

"William F. Robertson, Jr." wrote:
Your first statement is not true. Assemblies are loaded the first time a
type is loaded from the assembly.

HTH,

bill
"BrianS" <Br****@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
What is the best strategy for dynamic loading private assemblies in

asp.net?
I understand, and have confirmed, that any dll placed in the app's /bin

dir
will get loaded on startup. This is not desirable.

I have a web service that, based on an input parameter, dynamically loads

A,
B or C library. I also understand that an separate AppDomain is needed to
explicitly unload the Assembly. No other apps will use these assemblies.

Do I need an IPlugin Interface type architecture to correctly achieve

this?

Where should I put the "sub" assemblies?

Do I use Load, LoadFrom or LoadFile?

Regards,
Brian


Nov 19 '05 #3
I was not aware of that. Thanks for the info.

When I have needed to create an instance of a type in a difference assembly,
I have used LoadFile.

System.Reflection.Assembly ass = System.Reflection.Assembly.LoadFile(
assemblyPath );

HTH,

bill

"BrianS" <Br****@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
This is true for Windows forms, but not Asp.Net.

Throw any dll in yopur apps /bin dir, then on startup query the assembly
with reflection on startup:

Dim myAssemblies() As [Assembly] = AppDomain.CurrentDomain.GetAssemblies

asp.net always loads assemblies because of machine.config setting <add
assembly="*" />

"William F. Robertson, Jr." wrote:
Your first statement is not true. Assemblies are loaded the first time a type is loaded from the assembly.

HTH,

bill
"BrianS" <Br****@discussions.microsoft.com> wrote in message
news:47**********************************@microsof t.com...
What is the best strategy for dynamic loading private assemblies in

asp.net?
I understand, and have confirmed, that any dll placed in the app's /bin
dir
will get loaded on startup. This is not desirable.

I have a web service that, based on an input parameter, dynamically
loads A,
B or C library. I also understand that an separate AppDomain is needed

to explicitly unload the Assembly. No other apps will use these assemblies.
Do I need an IPlugin Interface type architecture to correctly achieve

this?

Where should I put the "sub" assemblies?

Do I use Load, LoadFrom or LoadFile?

Regards,
Brian


Nov 19 '05 #4
If I were you, I'd use a different name
for the Reflection.Assembly instance.

:-)

Juan T. Llibre
ASP.NET MVP
===========
"William F. Robertson, Jr." <th****@nameht.org> wrote in message
news:O0****************@TK2MSFTNGP14.phx.gbl...
I was not aware of that. Thanks for the info.

When I have needed to create an instance of a type in a difference
assembly,
I have used LoadFile.

System.Reflection.Assembly ass = System.Reflection.Assembly.LoadFile(
assemblyPath );

HTH,

bill

"BrianS" <Br****@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
This is true for Windows forms, but not Asp.Net.

Throw any dll in yopur apps /bin dir, then on startup query the assembly
with reflection on startup:

Dim myAssemblies() As [Assembly] = AppDomain.CurrentDomain.GetAssemblies

asp.net always loads assemblies because of machine.config setting <add
assembly="*" />

"William F. Robertson, Jr." wrote:
> Your first statement is not true. Assemblies are loaded the first time a > type is loaded from the assembly.
>
> HTH,
>
> bill
>
>
> "BrianS" <Br****@discussions.microsoft.com> wrote in message
> news:47**********************************@microsof t.com...
> > What is the best strategy for dynamic loading private assemblies in
> asp.net?
> > I understand, and have confirmed, that any dll placed in the app's /bin > dir
> > will get loaded on startup. This is not desirable.
> >
> > I have a web service that, based on an input parameter, dynamically loads > A,
> > B or C library. I also understand that an separate AppDomain is
> > needed to > > explicitly unload the Assembly. No other apps will use these assemblies. > >
> > Do I need an IPlugin Interface type architecture to correctly achieve
> this?
> >
> > Where should I put the "sub" assemblies?
> >
> > Do I use Load, LoadFrom or LoadFile?
> >
> > Regards,
> > Brian
>
>
>


Nov 19 '05 #5

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

Similar topics

0
by: Parag Joshi | last post by:
hi, I am facing a wierd problem with dyanamic class loading. I have a namespace called ETS.DAO which contains my Data Access Object classes. All these classes implement a common interface which...
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...
0
by: Thomas W. Brown | last post by:
I have a C# library that dynamically creates a in-memory assembly and creates instances of the objects therein. From .NET applications, this works perfectly well. However, when I wrap this...
2
by: Matt | last post by:
I'm hoping someone can steer me in the right direction to try to do the following: I am developing an application where we receive files from customers. Right now we receive a variety of...
3
by: dhnriverside | last post by:
Hi guys I'm writing a console app in C# for which i want to enable the user to have several "plug-ins". The app has a switch to set the plug-in to use, and at runtime the required dll is loaded...
4
by: Barry Kelly | last post by:
I'm designing an application framework which will, amongst other things, live in an assembly hosted in the ASP.NET worker process, servicing webservice requests. Here's the scenario: APPFX is...
0
by: Stefan Rosenthal | last post by:
Hi all, I've an OL-Style App loading MDIChild-Windows (Panes) on demand dynamicaly at runtime. Loading the Forms works fine but establishing an EventHandler (to receive information from the...
8
by: George Meng | last post by:
I got a tough question: The backgroud for this question is: I want to design an application works like a engine. After release, we can still customize a form by adding a button, and source code...
11
by: Sean M. DonCarlos | last post by:
I have an unmanaged Win32 app that looks up the name of a DLL (unknown at compile time) from an external location, loads it with LoadLibrary, and then uses GetProcAddress on three exported...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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...

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.