views:

55

answers:

1

Sometimes, a customer (or tester) needs a patch on an installation of the product I work on. Sometimes, I brew him a dll containing the fix, so that he can test it. He overwrites the old dll with the new version and restarts the app.

Every now and then, it appears that the 'new' dll isn't actually used, although I'm absolutely positive that my brand new sparkling bytes were copied over the old dll.

To make things worse, after the first 'hotfixed' run, when restarting the application, the new functionality clearly is loaded..., and the old behaviour is never to be seen again.

Has anyone observed this behaviour? Would it be possible that the XP loader sort of 'caches' recently used dlls?

(Note: this happens on XP SP2)

+1  A: 

Yes, this is possible. Windows does not let you delete files which are in use, but strangely enough (for Windows at least) you can rename a DLL while it is still in use. If your tester uses something along

  • rename dll to dll.orig
  • copy new dll
  • restart application

it can happen, that the dll.orig version is still used if it has not been completely unloaded (because some still started app still has a reference to it).

This has bitten me a few times, too. I therefore usually change some behavior (mostly something of the header of the log-file) so that I can be sure that something has not been happened.

To workaround is simply: close all programs that use this DLL. Sysinternals Process Explorer helps to find the applications that use it.

gimpf
Thanks! Is this behavior documented somewhere?
xtofl
Well, probably it is, but I don't know. Got this knowledge through experiment. If, however, somebody could find a definitive source on this, I'd also be interested.
gimpf