Loading dlls from path specified in SetdllDirectory in c#

前端 未结 2 1227
盖世英雄少女心
盖世英雄少女心 2020-12-18 04:47

I am new in dotnet.I have a dotnet dll that loads a c dll by using DllImport. I want to place all the dlls in a folder which is diffrent from the l

2条回答
  •  攒了一身酷
    2020-12-18 05:20

    Take a look at the documentation for LoadFrom and you'll find that it says: If a native image exists for assemblyFile, it is not used. The assembly cannot be loaded as domain neutral.

    I believe you're going to need to add the DLL directory to the EXE's path.

提交回复
热议问题