Native dll in c# web app

schueffp at mskcc.org schueffp at mskcc.org
Wed Jun 15 10:48:47 EDT 2016


Hi Benjamin,

Thanks for the answer, but this does not help. I copied the dll already manually or automatically with the solution, but on runtime, the dll are not found.

The 20 dlls are

iconv.dll
libcairo-2.dll
libffi-6.dll
libgdk_pixbuf-2.0-0.dll
libgio-2.0-0.dll
libglib-2.0-0.dll
libgmodule-2.0-0.dll
libgobject-2.0-0.dll
libgthread-2.0-0.dll
libintl-8.dll
libjpeg-62.dll
libopenjp2.dll
libopenslide-0.dll
libpixman-1-0.dll
libpng16-16.dll
libsqlite3-0.dll
libtiff-5.dll
libxml2-2.dll
openslide-jni.dll
zlib1.dll

Maybe I miss one?

Another question related to that is:

How can I DllImport those libraries? E.g. which function provides libcairo-2.dll?

[DllImport("libcairo-2.dll")]
private static extern whichFunctionshouldBeHere(WhichArguments);


Best,
 Peter


-----Original Message-----
From: openslide-users [mailto:openslide-users-bounces+schueffp=mskcc.org at lists.andrew.cmu.edu] On Behalf Of Benjamin Gilbert via openslide-users
Sent: Wednesday, June 15, 2016 3:01 AM
To: openslide-users at lists.andrew.cmu.edu
Subject: Re: Native dll in c# web app

On Mon, Jun 13, 2016 at 09:59:45PM +0000, Peter via openslide-users wrote:
> I try to make a .net webapp for a openslide viewer.  Openslide depends 
> on
> 20 native c++ libraries which i cannot reference in the c# project 
> (visual studio 2015).  (iconv.dll, libtiff-5.dll, ...)
> 
> It keeps saying that those libraries are not a valid COM assembly.  Or 
> that they do not have an entry point.
> 
> In a normal C# app, I simply would copy the dlls to the /bin folder.  
> Then they are loaded when the program starts.  However, this does not 
> work for a webapp (it keeps saying that openslide or one of its 
> dependencies is not found).

Hi Peter,

I'm not very familiar with Visual Studio, but you may be able to fix this by having it copy the DLLs for you:

    http://stackoverflow.com/a/35960868/
    http://stackoverflow.com/a/5107759/

Does that work?

--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