[Mono-list] Exception with DllMap on Windows

Alan McGovern alan.mcgovern at gmail.com
Sun Apr 25 06:54:18 EDT 2010


Hey,

On Sat, Apr 24, 2010 at 3:09 PM, Andreas Färber <andreas.faerber at web.de> wrote:
>
> Am 24.04.2010 um 16:03 schrieb Alan McGovern:
>
>> There's no need to place P/Invokes in a separate assembly. There's no
>> benefit to it. As was said before, just use the windows name for each
>> library in your code and on non-windows platforms include the .config
>> file with the dllmap sections in it.
>
> That does not help with having a .exe.config on Windows though. You then
> need two configs and two binary distros.

You've misunderstood what I've said I think :) No matter what you do
you will always require either 1 or 2 .config files and 1 binary. Lets
take the typical example where the only reason for the .config is to
do dll remapping. In this (the most common) case, you will mark all
your P/Invokes with the windows binary name and distribute your binary
with no dllmap for windows based platforms.

If you want this binary to run unchanged on non-windows platforms
(maxos, linux) then all you have to do is ship the exact same binary
with a .config file containing the dllmaps. You do not require a
separate binary. So in this scenario you need 1 binary and 1 .config
file.

For the more complex case where your app has an existing .config file
which it requires on windows, you'll need two .config files. The
windows one will not contain the dllmap entries and the non-windows
one will. You still need only 1 binary in this case.

Alan.

>
> Andreas
>
>


More information about the Mono-list mailing list