Transitive compile assets in nuget
Hi everyone!
I'm banging my head against this issue I can't figure out. I have to (nuget) package a bunch of native libraries alongside a dotnet wrapper. I've set it up according to the docs (https://learn.microsoft.com/en-us/nuget/create-packages/native-files-in-net-packages) the following way
MyNative.Package
+-- runtimes
+-- win-x64
+-- native
+-- myNative.dll
+-- lib
+-- net8.0
+-- myWrapper.dll
And this all works fine when it's being used as a direct dependency, but as soon as I try to make use of it as a transitive dependency it fails. I.e. with this dependency graph, MyProject builds ok, but the tests don't.
MyProject.Tests -> MyProject -> MyNative.Package
Now the runtime dependencies (the native libraries) travel along to the bin/net8.0/runtimes/win-x64 folder just fine, but the compile assets (the wrappers) don't and I don't want to copy paste these to every project that uses them.
Any ideas how I can transitively pass along my compile assets via a nuget package? Thanks in advance!
Native files in .NET packages
How to pack native libraries in .NET packages
0 Replies