473,387 Members | 1,501 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.

DLL loading Question

How can i dynamically load a Dll and unload said Dll
using c#
i have a Situation where i have many dlls that are client based and only
need to be loaded and code executed based on client ID.

for instance
i have a Service Running the gets Record sets for output file formating
based on client Requirements
and this service reads a dll to load and instantiate classes based on
clientID

so service would load the dll
execute Class Inside the dll , create output file
service unload dll

TIA
DaveP

Sep 11 '07 #1
5 1863
You can use assembly class to load the dll if the dll is an assembly.

"DaveP" wrote:
How can i dynamically load a Dll and unload said Dll
using c#
i have a Situation where i have many dlls that are client based and only
need to be loaded and code executed based on client ID.

for instance
i have a Service Running the gets Record sets for output file formating
based on client Requirements
and this service reads a dll to load and instantiate classes based on
clientID

so service would load the dll
execute Class Inside the dll , create output file
service unload dll

TIA
DaveP

Sep 11 '07 #2
But you can't unload the dll unless you unload the app domain which the
assembly was loaded in. This would mean that you have to create a new app
domain and run the code in that app domain.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"David Yang" <David Ya**@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
You can use assembly class to load the dll if the dll is an assembly.

"DaveP" wrote:
>How can i dynamically load a Dll and unload said Dll
using c#
i have a Situation where i have many dlls that are client based and only
need to be loaded and code executed based on client ID.

for instance
i have a Service Running the gets Record sets for output file formating
based on client Requirements
and this service reads a dll to load and instantiate classes based on
clientID

so service would load the dll
execute Class Inside the dll , create output file
service unload dll

TIA
DaveP


Sep 11 '07 #3
any Examples anywhere that you may know of

doesn't SSiS do somthing like this with SSiS Packages

TIA
DaveP

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:OO**************@TK2MSFTNGP06.phx.gbl...
But you can't unload the dll unless you unload the app domain which the
assembly was loaded in. This would mean that you have to create a new app
domain and run the code in that app domain.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"David Yang" <David Ya**@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
>You can use assembly class to load the dll if the dll is an assembly.

"DaveP" wrote:
>>How can i dynamically load a Dll and unload said Dll
using c#
i have a Situation where i have many dlls that are client based and only
need to be loaded and code executed based on client ID.

for instance
i have a Service Running the gets Record sets for output file formating
based on client Requirements
and this service reads a dll to load and instantiate classes based on
clientID

so service would load the dll
execute Class Inside the dll , create output file
service unload dll

TIA
DaveP



Sep 11 '07 #4
On Sep 11, 3:24 pm, "DaveP" <dvs_...@sbcglobal.netwrote:
any Examples anywhere that you may know of

doesn't SSiS do somthing like this with SSiS Packages

TIA
DaveP

"Nicholas Paldino [.NET/C# MVP]" <m...@spam.guard.caspershouse.comwrote in
messagenews:OO**************@TK2MSFTNGP06.phx.gbl. ..
But you can't unload the dll unless you unload the app domain which the
assembly was loaded in. This would mean that you have to create a new app
domain and run the code in that app domain.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"David Yang" <David Y...@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
You can use assembly class to load the dll if the dll is an assembly.
"DaveP" wrote:
>How can i dynamically load a Dll and unload said Dll
using c#
i have a Situation where i have many dlls that are client based and only
need to be loaded and code executed based on client ID.
>for instance
i have a Service Running the gets Record sets for output file formating
based on client Requirements
and this service reads a dll to load and instantiate classes based on
clientID
>so service would load the dll
execute Class Inside the dll , create output file
service unload dll
>TIA
DaveP- Hide quoted text -

- Show quoted text -
Hi Dave,
I have done what I think you are trying to do using reflection. Your
app would then have to be aware of the dll's interface and then load
that at runtime.
Maybe this is not what you are looking for. Check out some plugin
examples at CodeProject.
Jeff

Sep 12 '07 #5
sounds like thats exactly what im looking for
i need to load and unload the dlls base on customer transactions

tks i'll go look up the plug ins in codeproject
DaveP

"Hoop" <jc******@oshtruck.comwrote in message
news:11**********************@o80g2000hse.googlegr oups.com...
On Sep 11, 3:24 pm, "DaveP" <dvs_...@sbcglobal.netwrote:
>any Examples anywhere that you may know of

doesn't SSiS do somthing like this with SSiS Packages

TIA
DaveP

"Nicholas Paldino [.NET/C# MVP]" <m...@spam.guard.caspershouse.comwrote
in
messagenews:OO**************@TK2MSFTNGP06.phx.gbl ...
But you can't unload the dll unless you unload the app domain which
the
assembly was loaded in. This would mean that you have to create a new
app
domain and run the code in that app domain.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"David Yang" <David Y...@discussions.microsoft.comwrote in message
news:25**********************************@microso ft.com...
You can use assembly class to load the dll if the dll is an assembly.
>"DaveP" wrote:
>>How can i dynamically load a Dll and unload said Dll
using c#
i have a Situation where i have many dlls that are client based and
only
need to be loaded and code executed based on client ID.
>>for instance
i have a Service Running the gets Record sets for output file
formating
based on client Requirements
and this service reads a dll to load and instantiate classes based on
clientID
>>so service would load the dll
execute Class Inside the dll , create output file
service unload dll
>>TIA
DaveP- Hide quoted text -

- Show quoted text -

Hi Dave,
I have done what I think you are trying to do using reflection. Your
app would then have to be aware of the dll's interface and then load
that at runtime.
Maybe this is not what you are looking for. Check out some plugin
examples at CodeProject.
Jeff

Sep 14 '07 #6

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

Similar topics

1
by: BKM | last post by:
I've been using the following 2 ways to make sure my WebBrowser is finished loading a page before continuing with the next code. do:doevents:loop while WebBrowser.Busy do:doevents:loop until...
1
by: Stacey | last post by:
Hi, I'm hoping for a bit of advise-- I have a (relatively, from the point-of-view of this dilettante) complex script that attempts to preload certain images in order to trigger one of a series of...
3
by: markeboy | last post by:
I am wanting to control when a page is loaded using a separate class to manage when and how it should be loade My current implementation needs to set a property of the page programatically...
2
by: Bernie Yaeger | last post by:
This is a simple question without, I'm afraid, a simple answer: I am loading a datatable with a fill method in a load event of a window. I know how to hook up to the rowchanged event so that I can...
17
by: CES | last post by:
All, I was wondering if their is a way of loading an external script fill from within a script?? <script language="javascript" type="text/javascript"> function test(var){ <script...
1
by: Robert McLay | last post by:
I have been trying to build python on Cray X1. As far as I can tell it does not support dynamic loading. So the question is: How to build 2.4 without dynamic loading? That is: can I build...
1
by: Andrew Ducker | last post by:
I'm trying to load an assembly into a temporary AppDomain rather than my main AppDomain, so that it can be unloaded later on. However, it's also loading into my main AppDomain at the same time. ...
6
by: Dan Dorey | last post by:
I actually have two questions here, but I'll start by giving an outline of what I'm trying to do. I'm building an app with a simple plugin architecture (all in the same app domain). I have each...
1
by: aircraft | last post by:
Hi folks, I'm trying to load a mixed mode dll from a native c++ application using loadLibrary. If I run the application from the local drive it works without any problem, byt il I run it from the...
6
by: vunet | last post by:
This may be a strange question from a non-technical person who asked me to make his whole site and images load all at once. I.e. the completely loaded site would show up immediately even with a big...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.