Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3116

Including an unmanaged native library files to nuget output directory

$
0
0

unamanged shared object (.so file) does not copy to the output directory:

I have .netstandard 2 project that wraps a c++ library(lets call the project wrap.csproj).That project depends on shared object (libgdal.so).

I want to use this project as a nuget, and therefor, the projects that will reference my nuget should have the wrap.dll and the libgdal.so in the build/publish folder.

I packed this project as nuget.but projects( dotnet core) that reference this nuget does not get the libgdal.so file just the wrap.dll in the build/published folder and therefore I am getting run time error.

I add this properties to the nuget csproj:

<ItemGroup><None Include="libgdal.so"><Pack>true</Pack><CopyToOutputDirectory>Always</CopyToOutputDirectory></None></ItemGroup>

EDIT: after a little look from the help here of @zivkan I succeed

all I needed to do is to add the packagepath like that:

<ItemGroup><None Include="libgdal.so"><Pack>true</Pack><PackagePath>runtimes/linux-x64/native</packagePath><CopyToOutputDirectory>Always</CopyToOutputDirectory></None></ItemGroup>

Viewing all articles
Browse latest Browse all 3116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>