Regression in Winforms Support for version > 3.0

Baltasar GarcĂ­a Perez-Schofield <[email protected]> Wed, 9 Apr 2014 21:21:25 +0200
Newsgroups gmane.comp.gnome.winforms,gmane.comp.gnome.mono.general
Message-ID <CAGzCYFMDCR1_a0a+46h4cDdH-Q+RX38MNENNnt2fhDDOemru-w@mail.gmail.com>
--===============1615316553==
Content-Type: multipart/alternative; boundary=089e0149c39cb9a6fc04f6a101b0

--089e0149c39cb9a6fc04f6a101b0
Content-Type: text/plain; charset=ISO-8859-1

Hi, all of you.

I've finally found a solution to this problem by myself. Since probably
many people will stumble upon this, I think it is better to somehow
register it.

The problem seems to be in System.Drawing. When you try to launch an
application using WinForms, it crashes with:

==
Unhandled exception
...snip...
Missing dll: /tmp/install/lib/libgdiplus.so
==

This is particularly confusing on Windows, where one would think this file
should be already present.

The key to this problem is already in the Xamarin bugtrack system, bug 8309:
https://bugzilla.xamarin.com/show_bug.cgi?id=8309

The problem seems to be related to the following two lines in the file
$INSTDIR\etc\mono\config:

==

<dllmap dll="ggdiplus" target="/tmp/install/lib/libgdiplus.so" />
<dllmap dll="ggdiplus.dll" target="/tmp/install/lib/libgdiplus.so" />

==

Being INSTDIR the installation directory of mono. Note that this happens in
Windows, maybe that "etc" could be confusing, but it is just a subdirectory
of the mono installation.

Removing both lines immediately solves the problem.

==
Because bugs happen :)
Locate $mono-prefix/etc/mono/config and add an os="!windows" attribute
to all gdiplus & gdi32 DLL mapps.
==

Thanks Robert. I found the solution just before reading your message. I
suppose I've been more taxative.

This bug invalidates the use of this version of Mono for any final user
trying to run an application employing WinForms, and there are quite a lot
out there.

An yep, bugs happen. However, the bug was found in 11/2012 (mono 3.0.1),
and bug 14586, a duplicate of this bug, was (re-)found in 09/2013.
Currently, in 4/2014 (mono-3.2.3), the bug has not still been solved, while
the fix seems just to add an os="!windows" attribute to those lines.  I
understand that WinForms is not a valuable asset for Xamarin, but this
seems strange anyway.

-- Baltasar

--089e0149c39cb9a6fc04f6a101b0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi, all of you.<br></div><div><br></div><div>I&#39;ve=
 finally found a solution to this problem by myself. Since probably many pe=
ople will stumble upon this, I think it is better to somehow register it.</=
div>
<div><br></div><div>The problem seems to be in System.Drawing. When you try=
 to launch an application using WinForms, it crashes with:</div><div><br></=
div><div>=3D=3D</div><div>Unhandled exception</div><div>...snip...</div><di=
v>
Missing dll:=A0<span style=3D"color:rgb(0,0,0);font-size:medium;white-space=
:pre-wrap">/tmp/install/lib/libgdiplus.so</span></div><div>=3D=3D</div><div=
><br></div><div>This is particularly confusing on Windows, where one would =
think this file should be already present.</div>
<div><br></div><div>The key to this problem is already in the Xamarin bugtr=
ack system, bug 8309:</div><div><a href=3D"https://bugzilla.xamarin.com/sho=
w_bug.cgi?id=3D8309">https://bugzilla.xamarin.com/show_bug.cgi?id=3D8309</a=
><br>
</div><div><br></div><div>The problem seems to be related to the following =
two lines in the file $INSTDIR\etc\mono\config:</div><div><br></div><div>=
=3D=3D</div><div><pre class=3D"" style=3D"font-size:medium;white-space:pre-=
wrap;width:50em;color:rgb(0,0,0)">
&lt;dllmap dll=3D&quot;ggdiplus&quot; target=3D&quot;/tmp/install/lib/libgd=
iplus.so&quot; /&gt;
&lt;dllmap dll=3D&quot;ggdiplus.dll&quot; target=3D&quot;/tmp/install/lib/l=
ibgdiplus.so&quot; /&gt;</pre></div><div>=3D=3D</div><div><br></div><div>Be=
ing INSTDIR the installation directory of mono. Note that this happens in W=
indows, maybe that &quot;etc&quot; could be confusing, but it is just a sub=
directory of the mono installation.</div>
<div><br></div><div>Removing both lines immediately solves the problem.</di=
v><div><br clear=3D"all"><div>=3D=3D</div><div><span style=3D"font-family:a=
rial,sans-serif;font-size:13px">Because bugs happen :)</span><br style=3D"f=
ont-family:arial,sans-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">Locate $mono-pr=
efix/etc/mono/config and add an os=3D&quot;!windows&quot; attribute</span><=
br style=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"fon=
t-family:arial,sans-serif;font-size:13px">to all gdiplus &amp; gdi32 DLL ma=
pps.</span><br>
</div><div>=3D=3D</div><div><br></div><div>Thanks Robert. I found the solut=
ion just before reading your message. I suppose I&#39;ve been more taxative=
.</div><div><br></div><div>This bug invalidates the use of this version of =
Mono for any final user trying to run an application employing WinForms, an=
d there are quite a lot out there.</div>
<div><br></div><div>An yep, bugs happen. However, the bug was found in 11/2=
012 (mono 3.0.1), and bug=A014586, a duplicate of this bug, was (re-)found =
in 09/2013. Currently, in 4/2014 (mono-3.2.3), the bug has not still been s=
olved, while the fix seems just to add an=A0<span style=3D"font-size:13px;f=
ont-family:arial,sans-serif">os=3D&quot;!windows&quot; attribute to those l=
ines.=A0</span><span style=3D"font-size:13px;font-family:arial,sans-serif">=
=A0</span><span style=3D"font-size:13px;font-family:arial,sans-serif">I und=
erstand that WinForms is not a valuable asset for Xamarin, but this seems s=
trange anyway.</span></div>
<div><br></div><div dir=3D"ltr">-- Baltasar</div>
</div></div>

--089e0149c39cb9a6fc04f6a101b0--

--===============1615316553==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

--===============1615316553==--