Replies: 4 comments 1 reply
-
@WingZer0o you don't usually use content files for this. Instead, packages can contain runtime specific assets, which is described here: https://learn.microsoft.com/en-us/nuget/create-packages/native-files-in-net-packages Specifically, you need to package your native dlls in runtime specific folders that match the expected NuGet folder structure (which is linked on that page). If you do this, NuGet will tell the .NET SDK about the runtime assets during the Restore phase of the build, and the SDK will ensure that projects that reference your package have the Runtime-specific assets to their output folders when necessary. |
Beta Was this translation helpful? Give feedback.
-
I've changed my .csproj to the following with no results in geting the runtime assets to copy over on build. Does {rid} and {tfm} stand for anything. Wish the documentation here wasn't so cryptic on this topic. <Content Include="Contents/**/*.*">
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackagePath>runtimes\{rid}\lib\{tfm}/</PackagePath>
</Content> |
Beta Was this translation helpful? Give feedback.
-
These are Rust Native Libraries that are built with the crate type of |
Beta Was this translation helpful? Give feedback.
-
I was able to get this to work for the DLL in windows. I will try more tomorrow. Thanks!! |
Beta Was this translation helpful? Give feedback.
-
Hello there,
I have a Nuget Package that looks like this in Nuget Package Explorer.
This package is essentially a wrapper around a Rust library for Cryptographic algorithms. Now for the life of me, when I install this nuget package into a new project, that DLL and SO do not get transferred into the consuming project's bin.
To include this DLL and SO I am using the following in .csproj.
Is there a flag I can set in
.csproj
to copy those files when the nuget package is installed and built from within a consuming project or does this require a MsBuild.targets
file?Beta Was this translation helpful? Give feedback.
All reactions