运行具有本机依赖项的.NET Core nuget包,找不到库

时间:2017-02-27 22:51:54

标签: .net-core nuget-package

我已将这些添加到我的项目中。

<Content Include="../../native/medxdcmtk/lib/libmedxdcmtk.so">
  <PackagePath>runtimes/debian-x64/native/libmedxdcmtk.so</PackagePath>
  <Pack>true</Pack>
</Content>
<Content Include="../../native/dcmtk/lib/libdcmtk.so.10">
  <PackagePath>runtimes/debian-x64/native/libdcmtk.so.10</PackagePath>
  <Pack>true</Pack>
</Content>
<Content Include="../../native/medxdcmtk/lib/libmedxdcmtk.so">
  <PackagePath>runtimes/ubuntu-x64/native/libmedxdcmtk.so</PackagePath>
  <Pack>true</Pack>
</Content>
<Content Include="../../native/dcmtk/lib/libdcmtk.so.10">
  <PackagePath>runtimes/ubuntu-x64/native/libdcmtk.so.10</PackagePath>
  <Pack>true</Pack>
</Content>

生成的包看起来像:

nupkg

当我调用使用PInvoke的方法时,我得到了这个:

Error Message:
 System.DllNotFoundException : Unable to load DLL 'libmedxdcmtk': The specified module could not be found.
 (Exception from HRESULT: 0x8007007E)

这在ubuntu和debian(64bit)上都会发生。如果我将.so文件直接复制到/usr/lib,则可以正常工作。

为什么找不到我的原生组件?

0 个答案:

没有答案