I am trying to figure out how to unload and Unmanaged Dll that was originally loaded with DllImport, but I have not had any luck so far.
Let me explain the reason for wanting to do this. I have an unmanaged Dll containing resources. I load this dll and check it for a specified value. If that value does not exist, I want to update the resources. The problem I have run into is that the unmanaged Dll is not being unloaded after I check for the specified value and therefore I cannot update the Dll resources.
Can I use Dispose to unload the unmanaged Dll If so, how If I cannot unload the unmanaged Dll are there any other suggestions on how to update the Dll resources
Any help would be appreciated.

Unloading Or Releasing an Unmanaged Dll When Using DllImport???
isunshine
Dave Elliott Msdn
Cheers,
Bill
Antony Nguyen
Use GetModuleHandle and FreeLibrary which are WIN32 APIs.
The following link might be good pointer for you,
http://blogs.msdn.com/robgruen/archive/2004/11.aspx
HTH,
RickyBaaa
An alternative, since you really only care about the resources, would be to manually load the DLL using LoadLibrary(), doing your work and then calling FreeLibrary(). This sidesteps the CLR loading the binary completely. I'm not sure if it'll work for your case however.
Michael Taylor - 12/1/05