Native dll in c# web app
schueffp at mskcc.org
schueffp at mskcc.org
Wed Jun 15 19:03:07 EDT 2016
Hi Benjamin,
Thank you very much. Rewriting the wrapper with dllImport for every function explicitely did the job. Now, the dlls are accepted when they lie in the bin folder of the web-app.
Before, I indeed had the experience that they work in the C:\Windows folder, but not in the bin folder.
Thanks again to all, my problem is solved.
And the viewer is really fast! 😊
Best,
Peter
Sent from my iPhone
> Am 15.06.2016 um 17:18 schrieb Benjamin Gilbert via openslide-users <openslide-users at lists.andrew.cmu.edu>:
>
>> On Wed, Jun 15, 2016 at 02:48:47PM +0000, Peter via openslide-users wrote:
>> The 20 dlls are
>>
>> [...]
>>
>> Maybe I miss one?
>
> Hi Peter,
>
> You don't need openslide-jni.dll, since that's only used by OpenSlide Java.
> The rest of the list looks correct.
>
>> How can I DllImport those libraries? E.g. which function provides libcairo-2.dll?
>>
>> [DllImport("libcairo-2.dll")]
>> private static extern whichFunctionshouldBeHere(WhichArguments);
>
> I believe you should only need to DllImport the functions you need from
> libopenslide-0.dll. The rest of the DLLs are referenced by
> libopenslide-0.dll and should be loaded automatically.
>
> For the DLLs to be loaded at runtime, they need to be on your DLL search
> path. Googling turns up some references that claim that the bin directory
> of a web project is *not* on the search path. You can test this by putting
> the DLLs on the search path manually, e.g. by copying them to the Windows
> directory. (Of course, that's not something you should do in regular use.)
>
> Sebastian is correct, by the way, that you'll need to specify the cdecl
> calling convention in your DllImport attributes.
>
> --Benjamin Gilbert
> _______________________________________________
> openslide-users mailing list
> openslide-users at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/openslide-users
=====================================================================
Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.
More information about the openslide-users
mailing list