Windows caches .dll files to speed disk I/O.
However, even after you close the calling program, the .dll file remains cached.
To stop Windows from caching .dll files after you've closed the calling program, perform the following steps:
Start a registry editor (e.g., regedit.exe) and navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer registry subkey.
From the Edit menu, select New, DWORD Value. Enter the name AlwaysUnloadDLL, and then press Enter. Double-click the new value, set it to 1, and then click OK.
Close the registry editor, and then reboot the machine for the change to take effect.