[Mono-list] Exception with DllMap on Windows
Andreas Färber
andreas.faerber at web.de
Sun May 16 12:59:48 EDT 2010
Hi Alan,
Still owe you an answer here:
Am 25.04.2010 um 19:42 schrieb Alan McGovern:
> 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?
In my original post I wrote: ".NET used to care only about
the .exe.config file."
With "used to" I was referring to Microsoft .NET 1.1/2.0 and my pcsc-
sharp library, which is an MIT'ed binding that ships with
a .dll.config dllmap to accomodate PCSC-lite and a differing .so name
on Solaris 10.
I don't have access to Microsoft .NET 4.0 so I cannot say whether it
still works.
Regards,
Andreas
> 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/o dllmap] (typo!)
>> 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