A quick question: When declaring the DLLImport Attribute in .Net, where does the runtime look to resolve that DLL dependency? Would I have to dump the DLL and all of its dependencies in the bin folder?
To determine whether a DLL (or EXE) is managed or unmanaged, use dumpbin.exe with the /dependents switch. If you see mscoree. dll in the output, then the assembly is a managed assembly.
DllImport attribute uses the InteropServices of the CLR, which executes the call from managed code to unmanaged code. It also informs the compiler about the location of the implementation of the function used.
Dll files are located in C:\Windows\System32.
The term "managed code" usually refers to code written in a managed language, such as Java or C#. The term "unmanaged code" usually refers to code written in an unmanaged language, such as C or C++. If you're coming from the . NET world, "managed" probably means C# or VB.NET, and "unmanaged" probably means C or C++.
I think it is working like LoadLibrary.
Maybe Windows path searching in LoadLibrary with manifest will be helpfull.
Edit Dynamic-Link Library Search Order is probably what you want.
Generally, you'd expect it to look at whatever's defined in the user's Path.
To find out what this contains, from a command prompt, type echo %PATH%
[Enter]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With