[Mono-list] Exception with DllMap on Windows

Alan McGovern alan.mcgovern at gmail.com
Sun Apr 25 13:42:59 EDT 2010


If MyPinvokes.dll.config contains the <dllmap> attribute, would that
not make the MS framework barf just the same as if the p/invokes were
in your main assembly?

Alan.

On Sun, Apr 25, 2010 at 5:59 PM, Andreas Färber <andreas.faerber at web.de> wrote:
> Hi,
>
> 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
> [MyApp.exe.config - .NET only w/ dllmap]
> MyApp.exe.config - Mono only
> -> needs two binary distributions due to .exe.config
>
> Solution #2:
> MyApp.exe
> MyApp.exe.config
> MyPInvokes.dll
> 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,
>
> Andreas
>
>


More information about the Mono-list mailing list