I have a vb.net 3.5 application which references a dll (abc.dll, also in .net 3.5)
This dll is accessed by the application from time to time. If at anytime during execution, if I delete the dll, I expect the application to throw an error the next time it tries to use a class from the dll. But, this is not the behaviour I see. If I delete the dll before startup, the application throws an error at startup. But not when the dll is deleted after startup.
Is this the standard behaviour, or am I doing something wrong?
Can I get the app to throw an error if the dll is not found when it tries to use its classes?
Thanks in advance.
The short answer no. Once a DLL is loaded it is loaded until app
AppDomaininstances using that DLL are unloaded from the process. Only then can you delete the original DLL.Longer answer:
This is a complicated question because it depends on how the DLL is being loaded into the process. There are a couple of different ways this can occur