[Mono-winforms-list] Migrating Windows C#.NET WinForms Project to OSX

Baltasar García Perez-Schofield baltasarq at gmail.com
Fri Jul 19 12:35:48 UTC 2013


> I have a C#.NET Windows Forms project which compiles, builds and runs
> without any problems on Windows. Now I'm trying to migrate it to OSX
> using Mono. 
> I'm not sure why I get the exception saying that the
> requested feature isn't implemented?!?!

	When you click in the stack frame, Xamarin Studio is probably trying to open the corresponding source code file in order to show you where the call was done.

	Since probably you don't have the source code of WinForms installed, it fails, warning that the file is missing.

	Howver, the real problem is the upmost exception which is produced in SystrayAdd(), which is not implemented.

	There are some methods in a few libraries of the mono project which are not implemented. You can foresee the "problems" (missing methods such as this one, etc.) using Moma.


	Execute this tool on your executables, and study the missing classes and methods, then try to find a workaround for that missing stuff.


	Actually this is a known problem. You can find the corresponding bug in Ximian, at 2008:


	Since it is an error detected in 2008, I wouldn't expect it to be solved. This leads me to the current status of Winforms, which is deprecated. This means it is not actually supported by Xamarin.

	So, the only solution is not to use NotifyIcon in OS/X. I don't know whether that's possible in your app. In this case the workaround -if possible- does not seem to be easy.

	Mono has various Gui toolkits available: Gtk#, WinForms...

	The only possible solution is what it is described in the page of toolkits of the mono project, in "alternative implementation approaches":


	Separate your application in core and gui. Implement two gui's, one for Mac and another one for Windows (using your current WinForms module).

	For mac, probably the best choice is to use Gtk#.

Baltasar (baltasarq at gmail.com  http://baltasarq.info/)

More information about the Mono-winforms-list mailing list