473,761 Members | 3,187 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1499
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
PerformStandard Processing
If SpecialProcessi ngNeededForThis Customer Then
LoadCustomAssem blyForThisCusto mer
ExecuteCodeInCu stomAssembly
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
2734
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 desktop resolution. I have tried trapping the following events: 1) SDL_ACTIVEEVENT 2) SDL_VIDEOEXPOSE
1
2860
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 desktop resolution. I have tried trapping the following events: 1) SDL_ACTIVEEVENT 2) SDL_VIDEOEXPOSE 3) SDL_VIDEORESIZE
10
504
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 project (right?). So what have I gained by adding it to the GAC?
7
2423
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
1404
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 changed. Is the only way to do this to go through all the fields and check them against their old values. In which case, would I need to store the values in
5
1836
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 populated) is from several different tables. To the user, of course, this is not seen. Scenario: After the page is populated, assume a change is made to the form and the user hits update. The page then goes back, reads the database for that record...
2
278
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 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...
85
4856
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 standard. My question now is: Is there a chance that such statement will become a part of C standard in the future? In some cases using asm language is the best way to acomplish some small task, hence integration of C and asm would greatly enhence C,...
5
2629
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 machine, every thing works. But when we put the whole program on network drive, the VB6 program could not create required object from .NET assembly. Nothing we done were not useful to help to solve the problem. Does anybody have idea?
0
10123
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9975
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9909
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9788
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8794
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6623
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5241
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3481
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.