[Mono-dev] unsafe C# code not working under mono

Marek Habersack grendel at caudium.net
Fri Nov 25 05:14:23 EST 2005


Hello everybody,

  I've been recently implementing CAPTCHA for a customer and I had come
across the article @codeproject (http://www.codeproject.com/aspnet/WSCaptcha.asp)
which implements quite a nice version of it. Since I didn't want a service
but just a simple HttpHandler module, I wrote one that integrated the
graphics generation code from the above article. Among the source files I
used is the Filters.cs which you can find in the article's src zip (or in
another article at http://www.codeproject.com/cs/media/displacementfilters.asp). 
  The code in that file uses unsafe code blocks to manipulate bitmaps. Everything 
compiles fine and my handler module generates images with text on them. The
problem is that the code (compiled by mcs) doesn't produce the graphics
effects when running under mono (under Ubuntu) but DOES generate the effects 
when ran under MS .Net 1.1 (using the same handler .dll compiled by mcs).
  I have attached samples of the graphics generated by the same DLL under
both environments. The source code to the handler is available at
http://grendel.thanes.org/monocode/Captcha.tar.bz2.
  Does anyone have an idea of what might be going on? At first I thought
that mcs was generating incorrect code, but then seeing that the same binary
works under MS .Net and doesn't under mono I figured it must be a runtime
problem.
  The version of mono I'm using is (daily updated) SVN HEAD.

thanks in advance,

marek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CaptchaImage.aspx-mono.jpeg
Type: image/jpeg
Size: 3433 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051125/1b01b945/attachment.jpeg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CaptchaImage.aspx-ms_dotnet_1.1.jpeg
Type: image/jpeg
Size: 3433 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051125/1b01b945/attachment-0001.jpeg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051125/1b01b945/attachment.bin 


More information about the Mono-devel-list mailing list