[Mono-dev] Mixed Mode Assemblies
pablo.ruiz at gmail.com
Sat Jul 9 08:13:42 EDT 2011
Another 'problem' with this approach is size. Due to the fact that the
native component I'm using it's quite big (chrome + qt are quite huge), the
final assembly weights a few MBs.. :(
On Sat, Jul 9, 2011 at 2:10 PM, Pablo Ruiz <pablo.ruiz at gmail.com> wrote:
> Well, I managed to do exctly this (extracting embedded .dll/.so & it's
> dependencies on Win32/Win64/Linux32/Linux64) on WkHtmlToXSharp (
> And I got fine results. It has some limitations (like being able to write
> on working dir, etc.) but it makes deployment alot easier. I even check if
> the file exists before extracting to allow onfield upgrade of native
> On Sat, Jul 9, 2011 at 2:05 PM, Robert Jordan <robertj at gmx.net> wrote:
>> On 09.07.2011 12:20, Quandary wrote:
>> > It's true that p/Invoke + InterOp services do not form a complete
>> > However, creating a interface in managed code across platforms isn't
>> > very difficult.
>> > All you need to do is to pack a x86&x64&ARM&PPC Linux&Windows&Mac
>> > version of the native dll into the .NET dll's ressources, then stream
>> > the respective assembly out on the calling of the constructor, and
>> > create an abstract class, where you create an instance for the
>> > respective platform (for example because of structs, where on x64, there
>> > are different sizes of long + int on Windows& Linux/UNIX), which you
>> > can then invoke as an interface.
>> Extracting and loading native libraries at run-time won't work
>> correctly on sane systems, unless you somehow manage to (1)
>> extract them into a path already configured as a library path,
>> (2) using absolute paths in DllImport attributes, (3) generating
>> DllImport code at run-time or (4) loading the libs and their
>> exports w/out DllImport's help (dlopen, LoadLibrary etc.).
>> That's why nobody is using such an approach in real world,
>> at least not under Unix. Using <dllmap> or a starter shell
>> script that sets the LD path is by far less complex (a
>> matter of minutes to develop).
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list