-
Notifications
You must be signed in to change notification settings - Fork 511
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
.NET: Add support for producing a self-contained native framework/library #15217
Comments
I work for a larger organization that is reviewing how to build our next software platform. Our current platform was built with .NET. Not being able to produce native libraries for mobile platforms (Android, iOS), such that our customers can integrate them into their own native mobile apps out of the same .NET code base, may be a deal breaker for .NET. Without this capability, we will face the decision whether to stay with .NET or to move to another platform like Rust. We would like to therefore state that we are highly interested in this capability in .NET! |
My organisation also has shared code base which is getting used from desktop app and mobile app. For Mobile app we were using https://github.com/mono/Embeddinator-4000. However for MAUI(dotnet 6.0 onwards) library, we are clueless. |
Hi @rolfbjarne |
@hugener right now this is not on our roadmap to be implemented for .NET 8 (which may change, but as of right now that's what I know). |
I'm in a very similar situation to @dasmihir20: my company would seriously evaluate Native AOT technologies to produce libraries, and would be especially interested in iOS/Android, because .NET runtime is not easy/impossible to deploy in these platforms.
Definitely. Consider dylibs can be easily converted to framework by patching the file as a very minimum, plus one would have to define a manifest |
It might be possible, but it's not going to be easy. The process would involve building a complete app bundle, and then looking that the intermediate native (.m/.s) files and manually recompiling them yourself into a dylib/framework. You'd probably run into a lot of problems along the way, and I'm not sure they'll all be solvable. |
Maybe what's being cooking on Native AOT involves a completely different technology? Looking at what Native AOT does when |
Yes, NativeAOT is a very different process, but at the moment NativeAOT doesn't support iOS, so that's not an option if you want to hack something together today. |
Any update on this? I'm facing apple store issue for uploading the dylibs, and I don't know why my framework is not working when I converted dylibs libs into it. I'm using GDAL libraries, I upgraded them and now they just came up with dynamic kind with C# bindings. |
@huzaifacontour it might be possible to publish to a native library using NativeAOT: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/?tabs=net8plus%2Cwindows#build-native-libraries, but you'd only be able to use the .NET base class library (and your own custom code), but none of the iOS-specific bindings we ship in the iOS SDK. |
@rolfbjarne I resolved the above issue by converting the libraries to framework of two archs x86_64 and arm64, It's working with this but when I converted the framework to xcFramework and added as a native reference I'm having access to path denied: |
Please file a new issue to avoid making things confusing here, and also get a binary build log (https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#binary-build-logs), that will make diagnosis much easier. |
This is a meta/placeholder issue for tracking the interest in and the work required to produce a self-contained native framework or library in .NET.
In particular we're not committing to actually implementing this, no decision has been made yet.
There are several questions that would have to be answered and solutions designed before we can even think about starting to work on this.
Open questions:
[UnmanagedCallersOnly]
attribute would be the simplest, but it would also not enable some more complex scenarios (such as subclassing a managed class in Objective-C for instance).Random thoughts:
Ref:
The text was updated successfully, but these errors were encountered: