We have a class library (C++) that is compiled into a dynamic library (.dll, .so etc.) on various platforms. The dynamic library is then loaded using P/Invoke from .NET including a .NET Standard 2.1 assembly. Now, we want to do the same on iOS. My understanding is that we can compile our C++ code to an iOS .dylib, create a dynamic framework with this .dylib, and somehow consume this .dylib via the framework in the .NET Standard 2.1 assembly. Is there a way for this, or such a combination won't work?
Asked
Active
Viewed 173 times
0
-
You can create a native library and warp the native library then distribute the .net warpper with nuget ,at last consume the .net wrapper from xamairn.iOS project . Refer to https://learn.microsoft.com/en-us/xamarin/cross-platform/cpp/. – ColeX Jun 24 '21 at 07:24
-
@ColeX-MSFT Thank you. Our goal was to try to use p/invoke. We wanted to avoid creating separate assemblies for xamarin.android and xamarin.ios (which we already have), and reuse .NET Standard assemblies instead. Wanted to do some optimization of processes. But it looks like that's not doable, from what I figured out from scattered information elsewhere. – Eugene Mayevski 'Callback Jun 24 '21 at 20:40