1

When change the dll, I have to put it in a directory from where the system loads into memory. The problem is that everytime I change it, I have to close the system, replace the dll with a new one and start the system. It takes around 15/20 minutes which isvery long.

Can anyone tell me how to avoid this ?

asit_dhal
  • 1,239
  • 19
  • 35

1 Answers1

0

When you quickly want to switch DLL versions, place the DLL in the same directory as the executable or provide a path to the directory where you switch your DLLs in Project Settings -> Configuration Properties -> Debugging -> Environment. Then you don't have to mess with you Windows System directory.

However, Microsoft states here:

If a DLL with the same module name is already loaded in memory, the system checks only for redirection and a manifest before resolving to the loaded DLL, no matter which directory it is in. The system does not search for the DLL.

You could try if AlwaysUnloadDLL works for you.

c_k
  • 1,746
  • 1
  • 20
  • 35
  • The Directory in which Visual Studio places the dlls is fixed, I can't change it. The directory from where the system picks up dlls is also fixed and can't be altered. What I need here is some kind of batch program or any utility program, that will kill the processes accessing the dlls, then replace the dlls and then restart the program. – asit_dhal Mar 19 '13 at 18:23
  • 1
    You mean the DDLs which are already loaded into memory? When they are not loaded already, my answer actually applies. Please see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx and a similar question: http://stackoverflow.com/questions/518228/is-it-possible-to-add-a-directory-to-dll-search-path-from-a-batch-file-or-cmd-sc If this is not what you are looking for, please explain your problem more clear. – c_k Mar 20 '13 at 13:04
  • That Microsoft link is very helpful. I mean the DLLs which are already loaded into memory. I want to replace the DLL files and reload again into memory. – asit_dhal Mar 20 '13 at 14:48