Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How do I include native assemblies as a NuGet runtime with .NET Core projects? #1758

Closed
pauldotknopf opened this issue Feb 27, 2017 · 3 comments
Labels

Comments

@pauldotknopf
Copy link

pauldotknopf commented Feb 27, 2017

For example, runtime/debian and runtime/win-64, etc.

Similar to how the libuv packages are delivered through NuGet here.

@dasMulli
Copy link
Contributor

The pack targets look for metadata on a few known item types, I've been able to include msbuild files using the following inside an <ItemGroup>:

<None Update="build\**\*" Pack="true" PackagePath="\build" />

So I suppose you could do something like:

<None Update="runtime\**\*" Pack="true" PackagePath="\runtime" />

which will pack all

@pauldotknopf
Copy link
Author

Great.

I got it working.

    <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>

However, when I run this, I can't pinvoke. I get "System.DllNotFoundException : Unable to load DLL 'libmedxdcmtk': The specified module could not be found.".

If I copy the two libs directly into /usr/lib, it works, so I know it isn't an issue with the binaries. It is an issue with the dotnet runtime not loading the native packages correctly.

I am using dotnet cli "1.0.0-rc4-004771".

@rainersigwald
Copy link
Member

A straightforward solution for this moving forward should come with #5037.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants