To Alan's point, we did see crashes when we (unintentionally) deployed 
Mono.Posix.dll along with our app. Our solution was, like he said, to Not Do 
That, and use our Mono.Posix as a compile-time library only.

I do think it's much easier to do it this way than to have different compile 
targets, which (if I'm understanding correctly) is what the other suggestions 
all require.

chris

-----Original Message-----
From: mono-devel-list-boun...@lists.ximian.com 
[mailto:mono-devel-list-boun...@lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: Wednesday, March 30, 2016 7:04 AM
To: Alan McGovern <alan.mcgov...@gmail.com>
Cc: mono-devel-list <mono-devel-list@lists.ximian.com>
Subject: Re: [Mono-dev] Cross Platform on Linux/Windows with Mono.Posix 
reference on Linux

On Mar 30, 2016, at 8:33 AM, Alan <alan.mcgov...@gmail.com> wrote:
> If you package Mono.Posix.dll your app *will crash* on different systems.

Not necessarily.

> This binary is platform specific and is not safe to copy between OS’s.

Mono.Posix.dll *itself* contains no platform-specific code and is perfectly 
safe to copy between operating systems.

Mono.Posix.dll contains P/Invokes into “MonoPosixHelper” 
(libMonoPosixHelper.dylib on OS X, MonoPosixHelper.dll on Windows, etc.), and 
MonoPosixHelper contains operating system-specific code. It *cannot* be copied 
between operating systems; it’s a native library.

> It's fine to have a copy of Mono.Posix.dll used purely for compilation 
> purposes. But at runtime you have to use the system provided one, which 
> typically means the one provided by the system's mono installation.

It’s entirely fine to include Mono.Posix.dll with your app, SO LONG AS you 
*also* copy and distribute MonoPosixHelper with your app.

Additionally, Mono.Posix.dll also P/Invokes other native libraries such as 
INTL.DLL (Mono.Unix.Catalog) and MSVCRT.DLL (Mono.Unix.Native.Stdlib), which 
should be usable on Windows (so long as you also distribute INTL.DLL, etc.).

 - Jon

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to