[Mono-list] Exception with DllMap on Windows

Andreas Färber andreas.faerber at web.de
Sun Apr 25 12:59:53 EDT 2010


Am 25.04.2010 um 12:54 schrieb Alan McGovern:

> 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, I understood that perfectly well and it is a valid solution. I did  
however offer an alternative solution that is valid just as well. They  
are for different use cases and it is up to the OP to decide which one  
suits him best.

Solution #1:
[MyApp.exe.config - .NET only w/ dllmap]
MyApp.exe.config - Mono only
-> needs two binary distributions due to .exe.config

Solution #2:
MyPInvokes.dll.config - w/ dllmap
-> can be shared between .NET and Mono

There's differences in both files and packaging. If you want to zip it  
up and do write-once-run-everywhere then my solution is superior  
(think of Mono.Posix and of development on Windows); if you use OBS  
and thus don't care then your solution is easier, no question.

Hope that explains,


More information about the Mono-list mailing list