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

change 1 service when main application is running

i have 1 main winapplication.
3 services ,each in dll.

each service is created for telephony user.
each service is destroyed when the telephony user is hangUp.

is there a way to recompile the dll service (to add for example 1 line of
code/fix smale bug/small change ) while the main winappilcation is running.
this is very important.
cause if for example the main appilcation serves 100 telephony users 24
hours. (avg)
i can't shut down the system,disconnect all callers,
just to add 1 lines of code , in specific service (that no caller is
currently using,(at the time of recompiling).

ive try to recompile the dll after i destry the object i created from the
dll and after tell the gc to clean it.

even that, the process is still using the dll.
anyone have other way to solve this problem ?

remember the problem is :
changing 1 serviceONE, while 100 callers r currently using ServiceTwo and
ServiceThree.
than after changing the serviceOne in code ,
i could transfer new caller to the updated serviceOne .
<--all this , while the main application is alway open.

hope im clear.

thanks and have a nice day.

Jul 19 '05 #1
4 1870
Daylor <Da****@012.net.il> wrote:
i have 1 main winapplication.
3 services ,each in dll.


When you say "service" here, do you mean Windows service or not?

If you don't, then probably AppDomain unloading is what you're looking
for. You'll need to change things so that each of your DLLs is only
used in its own AppDomain, and provide some way of unloading that
AppDomain when you want to replace the DLL.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Jul 19 '05 #2
hi.
i dont mean Window Service.
there is problem if i create AppDomain in every service.

its mean,that i will have 30 appDomain in the process (or even 100 in near
future).
this is to much i think.

and the second reason,is that , the dll (service object),recived and used
the main classes in the win application.
as i know, passing and using object from diffrent appDomain, is very heavy
and not recommended for this situations.
imagine that every second line of code , will call from the service
appdomain , to the main appdomain.not good i think.(and im talking about 30
/100 appDomains)

any other suggestions ?
"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Daylor <Da****@012.net.il> wrote:
i have 1 main winapplication.
3 services ,each in dll.


When you say "service" here, do you mean Windows service or not?

If you don't, then probably AppDomain unloading is what you're looking
for. You'll need to change things so that each of your DLLs is only
used in its own AppDomain, and provide some way of unloading that
AppDomain when you want to replace the DLL.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Jul 19 '05 #3
ok, im going to try to create the service in appDomain.

what r the diff between class that exist in thread, and class that exist in
appDomain ?

1.passing classes r "expensive".
2.if the appDomain is crush the process is crush too ,not ?
3.i think unloading appDomain (and by that unload the dll),will not work,
cause the problem is not with .Net , the problem is with Win32.
meaning:when u load dll in win32 process. u can't unload it.
4.more main diff between appDomain and threads will be help to know.

thanks for your replies.

"Jon Skeet" <sk***@pobox.com> wrote in message
news:MP************************@news.microsoft.com ...
Daylor <Da****@012.net.il> wrote:
there is problem if i create AppDomain in every service.

its mean,that i will have 30 appDomain in the process (or even 100 in near future).
this is to much i think.


Not sure - I haven't tried it, but it would be worth investigating.
and the second reason,is that , the dll (service object),recived and used the main classes in the win application.
as i know, passing and using object from diffrent appDomain, is very heavy and not recommended for this situations.


It certainly needs to be done carefully. MarshallByRefObject can help a
lot there, if you know what you're doing.
imagine that every second line of code , will call from the service
appdomain , to the main appdomain.not good i think.(and im talking about 30 /100 appDomains)


I don't know - I haven't looked at the performance implications. Have
you? It sounds like it would be at least worth investigating.
any other suggestions ?


Have each service as a separate process, or have some way that you can
start a new process and receive new requests in that process, ditching
the old process when it's no longer being used.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Jul 19 '05 #4
Daylor <Da****@012.net.il> wrote:
ok, im going to try to create the service in appDomain.

what r the diff between class that exist in thread, and class that exist in
appDomain ?
It's not an either/or. *Everything* lives in some app domain, and *all*
code is run in a thread.
1.passing classes r "expensive".
Not necessarily. Marshalling by reference is fairly cheap.
2.if the appDomain is crush the process is crush too ,not ?
Do you mean if the app domain *crashes*? It depends on the way in which
it crashes.
3.i think unloading appDomain (and by that unload the dll),will not work,
cause the problem is not with .Net , the problem is with Win32.
meaning:when u load dll in win32 process. u can't unload it.
Loading a DLL in .NET isn't the same as it is in straight Win32. You
definitely *can* unload an AppDomain and then delete/change the DLLs it
had loaded.
4.more main diff between appDomain and threads will be help to know.


They're completely separate concepts. I suggest you get hold of a good
..NET book such as Jeffrey Richter's Applied Microsoft .NET Programming
which explains it all fairly thoroughly.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Jul 19 '05 #5

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

Similar topics

7
by: Ross Presser | last post by:
OK, I've been researching this problem and can't find a definitive answer yet. The situation is one that seems to have come up a few times to different folks. I am writing an application that...
4
by: Daylor | last post by:
i have 1 main winapplication. 3 services ,each in dll. each service is created for telephony user. each service is destroyed when the telephony user is hangUp. is there a way to recompile...
2
by: Drew Stoddard | last post by:
We are working in C#/Winforms and are using asynchronous client-side web service calls (the Begin... and End... methods supplied by the web reference creation). Many of these calls are contained...
2
by: R A | last post by:
Hi In Windows Service application where is the main function? I see that in my code I have static void Main() but when I put a break point it never gets there.
4
by: Keith | last post by:
I'm in the same boat as the fellow who posted this message back in August: Title : Windows Service, How does one make a service "fail" properly? Author : Ross Bennett Group :...
3
by: belgiozen | last post by:
Hi, I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the...
12
by: Noam | last post by:
I had originally written a program as a c# console application. The program used a reference that I wrote in c++. Later I was told to re-write the application as a windows service. When the service...
1
by: DLN | last post by:
Hello all, I'm running into a problem with one of our site's production web applications that was written in VB.net. The web app is running on W2K3/IIS6 and up until this afternoon, was working...
2
by: =?Utf-8?B?bXVyYWRqYW1lcw==?= | last post by:
Yes, sorry I tried to make it clear in the original question that I want to get the user token of the service - ie. the account the service is running under. I know services don't have user tokens...
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:
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: 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
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
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,...

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.