-
Notifications
You must be signed in to change notification settings - Fork 516
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
[native] Question: Only use runtimes/{rid}/native
without NativeReference
?
#14622
Comments
runtimes/{rid}/native
without NativeReference
? runtimes/{rid}/native
without NativeReference
?
Yes, it's correct that you can put native files (.a, .framework, .dylib) in However, if you have special requirements (such as additional linker flags for when we build the main executable), then you'll need a
Can you point us to these docs so that we can update them? |
Thanks for your explanation. It's not mentioned directly. I followed Working with Embedded Frameworks and added reference using Visual Studio for Mac, then found out what is added to There is also an older article, Referencing Native Libraries in Xamarin.iOS, telling me to add extra arguments. I hope we have some documentation explaining this .NET 6 feature, but I can't even find a clear documentation in .NET 6 or NuGet docs, although NuGet/Home#8623 and a StackOverflow answer explains some. |
Please note that Instead, you must create a NuGet package for these native libraries, then use Releated: dotnet/runtime#65420 and dotnet/sdk#16381 |
I'm currently building a native package for MacCatalyst and iOS.
For .NET 6 desktop platform like Windows/macOS desktop, I know putting native library files in
runtimes/{rid}/native
just work. However, Xamarin.iOS docs tells me that I must usePackNativeLibrary
item to add them, so I add a.target
file to my packge and it works.I also found that SkiaSharp.NativeAssets.MacCatalyst doesn't use
PackNativeLibrary
, it only put files inruntimes
. After testing this works well for me too.Now is what confusing me
Another package SkiaSharp.NativeAssets.iOS, doesn't like the one for catalyst, includes
.targets
files fornet6.0-ios13.6
andxamarinios1.0
. But it also works after removing these.targets
files. (Tested on simulator. I don't have any real iOS device, so I don't know if the behavior is the same on a real phone.)The question
By checking #11667, I believe just put these native files in
runtimes/{rid}/native
is enough, and noNativeReference
is required. Is that correct?The text was updated successfully, but these errors were encountered: