[Xapian-devel] C# bindings and string typed return values

Gregory freediving at gmail.com
Wed Mar 30 12:06:39 BST 2011


Hi, I've recently took to implementing Xapian as the search engine for
a website that is written in a Microsoft environment ie. C# asp.net on
IIS6/7.

Generally the bindings work perfectly, except when called from an IIS
application and only when the function being called returns a string
eg. GetTerm() or GetValue(). Which results in the application pool
crashing.

Digging into the errors seems to yield the following "Attempted to
read or write protected memory. This is often an indication that other
memory is corrupt."

I've done a little research on the topic and found the following
http://stackoverflow.com/questions/370079/pinvoke-for-c-function-that-returns-char.
Which suggests that the pinvoke implementation for string/char
returning functions isn't implemented in a way that supports CLR calls
(at least not in IIS).

Is there something I could do to fix that on my end or is it something
that needs to be changed in the bindings.

Thanks.



More information about the Xapian-devel mailing list