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

Detecting assembly changes

I'm writing an app that processes orders for various customers. For
most customers, the processing is the same. However, a few customers
require custom processing in addition to the standard processing that
is performed on all orders.

To accomplish this, I have created an interface and for the sake of
this question, it's only method is called SpecialProcess. For each
customer that requires special processing, I create a separate assembly
with a class that implements this interface. Then, during the
execution of the app, I check an .xml file to see if the particular
customer requires special processing and if so, I load the assembly for
that customer using reflection and execute the SpecialProcess method.

The application is implemented as a Windows service so it constantly
runs. My question concerns updating an assembly that may already be
loaded. I do not want to stop and restart the service if the custom
processing assembly requires changes. If an assembly is loaded again
but it is a different version, what would happen to the original loaded
assembly?

For example, say the application loads "Custom.dll, v 1.0" during it's
execution loop. Then say, that before the next time it needs to call
the custom.dll, it has been changed to version 1.1. When the code
that loads the assembly is executed, will both versions be in memory?
Or will the new version replace the older version? Will the .Net
runtime handle this for me properly?

I hope my question is clear. I know that I can use another AppDomain
to load the assembly and then unload the AppDomain to unload the
assembly, but is that the best way?

I merely need to be able to update an assembly without having to
restart the app that uses it.

Thanks,

Chris

Jul 21 '05 #1
2 1472
pm
You might want to take a look at this article, if you haven't already. It
may be of help.

http://www.15seconds.com/issue/040624.htm

"Chris Dunaway" wrote:
I'm writing an app that processes orders for various customers. For
most customers, the processing is the same. However, a few customers
require custom processing in addition to the standard processing that
is performed on all orders.

To accomplish this, I have created an interface and for the sake of
this question, it's only method is called SpecialProcess. For each
customer that requires special processing, I create a separate assembly
with a class that implements this interface. Then, during the
execution of the app, I check an .xml file to see if the particular
customer requires special processing and if so, I load the assembly for
that customer using reflection and execute the SpecialProcess method.

The application is implemented as a Windows service so it constantly
runs. My question concerns updating an assembly that may already be
loaded. I do not want to stop and restart the service if the custom
processing assembly requires changes. If an assembly is loaded again
but it is a different version, what would happen to the original loaded
assembly?

For example, say the application loads "Custom.dll, v 1.0" during it's
execution loop. Then say, that before the next time it needs to call
the custom.dll, it has been changed to version 1.1. When the code
that loads the assembly is executed, will both versions be in memory?
Or will the new version replace the older version? Will the .Net
runtime handle this for me properly?

I hope my question is clear. I know that I can use another AppDomain
to load the assembly and then unload the AppDomain to unload the
assembly, but is that the best way?

I merely need to be able to update an assembly without having to
restart the app that uses it.

Thanks,

Chris

Jul 21 '05 #2
Thanks for the link. It is very interesting, but not what I was
looking for. Basically my Windows service starts and then does some
processing each time a timer interval fires. In this processing is
code like this (pseudocode):

'This sub executed periodically in a timer event.
Public Sub Process()
GetCustomerData
PerformStandardProcessing
If SpecialProcessingNeededForThisCustomer Then
LoadCustomAssemblyForThisCustomer
ExecuteCodeInCustomAssembly
End If
End Sub

If, between the first and the next execution of the custom assembly
code, the assembly is replaced with an updated version, will it load
the new assembly and still keep the old loaded in memory? Or will the
new assembly replace the old one in memory?

Thanks

Jul 21 '05 #3

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

Similar topics

0
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
1
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
10
by: Simon Wallis | last post by:
I know the general purpose for the GAC is to share a component among many applications. But even when you add something to the GAC, you still have to manually create a reference to the DLL in your...
7
by: wij | last post by:
Hi: Is there better way of detecting multiplication overflow for type long than by using double precision of lldiv to verify the result? Thanks in advance. I.J.Wang
2
by: Simon Harvey | last post by:
Hi all, Is there any easy way to check a field for calues that have changed on a post back. So the page is sent to the user, the user changes some values and I need to know which ones...
5
by: needin4mation | last post by:
Hi, I have an asp.net 1.1 application that populates data from a database. When the user changes data, they have to hit a button to update the data. The data entry form (same form that is...
2
by: Chris Dunaway | last post by:
I'm writing an app that processes orders for various customers. For most customers, the processing is the same. However, a few customers require custom processing in addition to the standard...
85
by: fermineutron | last post by:
Some compilers support __asm{ } statement which allows integration of C and raw assembly code. A while back I asked a question about such syntax and was told that __asm is not a part of a C...
5
by: Igor | last post by:
Hi! We built VB6 application to work with Reporting Services server. To connect to reporting server has been created a special assembly with .NET VS2003. While we execute our program on local...
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
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
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,...
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.