You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the correct way to create a c# project with native dependencies
and make them flow to other project that depend on it ?
We are able to do it in nuget placing assets in the runtimes/rid/folders, but what is the csporj equivalent ?
Thanks
Reacted by john, 百地 希留耶, Alex Rønne Petersen and George Josh Karabin
I'm from dotnet/runtime#65420,
I think we need some Item like <NativeBinaryReference Include="native.dll" Rid="win-x64" /> to implement this, this can be use to both genereate nuget package and also for project reference.
Or , we should make the metadata PackagePath to be supported both on <PackageReference /> and <ProjectReference />.
Now that both iOS and Android supports this NuGet convention. However, if I don't want to create a native package, I need to use AndroidNativeLibrary for Android, but NativeReference for iOS. When it comes to WebAssembly, NativeFileReferencesis required. Furthermore, it looks like such an equivalent does not exist for Windows/Linux/macOS.
Platform
Item to Use
iOS
NativeReference
Android
AndroidNativeLibrary
WebAssembly
NativeFileReferences
Others
???
I really hope we have a unified item to cover all these differences.
Due to lack of recent activity, this issue has been labeled as 'Stale'. It will be closed if no further activity occurs within 14 more days. Any new comment will remove the label.
Activity
huoyaoyuan commentedon Apr 6, 2021
I'd ran into this. PackageReference supports the rid specification, but ProjectReference doesn't. I had to workaround by creating a temporary nupkg.
John0King commentedon Feb 27, 2022
I'm from dotnet/runtime#65420,
I think we need some
Itemlike<NativeBinaryReference Include="native.dll" Rid="win-x64" />to implement this, this can be use to both genereatenugetpackage and also forproject reference.Or , we should make the metadata
PackagePathto be supported both on<PackageReference />and<ProjectReference />.KiruyaMomochi commentedon Apr 5, 2022
From dotnet/runtime#65420 too.
Now that both iOS and Android supports this NuGet convention. However, if I don't want to create a native package, I need to use
AndroidNativeLibraryfor Android, butNativeReferencefor iOS. When it comes to WebAssembly,NativeFileReferencesis required. Furthermore, it looks like such an equivalent does not exist for Windows/Linux/macOS.NativeReferenceAndroidNativeLibraryNativeFileReferencesI really hope we have a unified item to cover all these differences.
Please also see #19929.
github-actions commentedon May 27, 2026
Due to lack of recent activity, this issue has been labeled as 'Stale'. It will be closed if no further activity occurs within 14 more days. Any new comment will remove the label.
taoyouh commentedon May 27, 2026
I think this is still a problem