Unable to load DLL The specified module could not

2019-08-28 17:46发布

When using [DllImport("my.cool.library")] with .NET you get an error similar to the following:

"Unable to load DLL... The specified module could not be found..."

...even though all the required DLLs are in place and clearly accessible!?

1条回答
三岁会撩人
2楼-- · 2019-08-28 18:35

Turns out DLLImport only assumes the ".dll" extension if you do not have periods in the name. If DLLImport("my.cool.library.dll") was used, it would work, otherwise the DLL will have to be renamed to "my_cool_library.dll", and then DLLImport("my_cool_library") will work. ;)

查看更多
登录 后发表回答