User:Closeapple/new/Wikipedia:FTCG on Mono

This is a document about using For The Common Good with Mono, which should allow FTCG to work on Linux and other non-Microsoft operating systems.

Using with Mono
Mono is a non-Microsoft implementation of .NET Framework. Non-Microsoft operating systems, such as Linux and MacOS, should be able to run For The Common Good using Mono.


 * 1) Install Mono on your system.
 * 2) * For Debian and Ubuntu distributions: Install the mono-runtime and mono-devel packages with whatever package manager you wish. (You need mono-devel temporarily only because you need the certmgr program to get Wikimedia's SSL certificates because FTCG uses HTTPS to communicate instead of HTTP.)  If you don't have a package manager preference, go to the command line and do this:
 * 3) *# When you are asked if you want to install some large number of packages (probably 190) or so, type y and hit Enter.
 * 4) * Mono's download page has download information for other platforms.
 * 5) Run certmgr to get the SSL certificates for Wikipedia:
 * 6) * You might be asked Import this certificate into the Trust store ? &mdash; type y and press Enter each time you are asked.
 * 7) *If certmgr dont work you can use mozroots to import certificates.
 * 8) Run FTCG.  From the command line, it's as easy as running the command "<tt>mono</tt>" with the location of the FTCG executable file:
 * 1) * You might be asked <tt>Import this certificate into the Trust store ?</tt> &mdash; type <tt>y</tt> and press Enter each time you are asked.
 * 2) *If certmgr dont work you can use mozroots to import certificates.
 * 3) Run FTCG.  From the command line, it's as easy as running the command "<tt>mono</tt>" with the location of the FTCG executable file:
 * 1) Run FTCG.  From the command line, it's as easy as running the command "<tt>mono</tt>" with the location of the FTCG executable file:

Problems

 * When I hit Go on a Wikipedia file, I get an error dialog that says "An Internet request failed. Error getting response stream (Write : The authentication or decryption has failed.) : SendFailure".
 * You didn't import the SSL certificates for Wikimedia sites into Mono yet. See the <tt>certmgr</tt> part of the instructions above.


 * When I hit Go on a Wikipedia file, FTCG crashes and exits. The diagnostic messages in the terminal window begin with <tt>Unhandled Exception: System.Net.ProtocolViolationException: The number of bytes to be written is greater than the specified ContentLength.</tt>  I've already installed the certificiates.
 * Here's where we have a problem!

The error
Unhandled Exception: System.Net.ProtocolViolationException: The number of bytes to be written is greater than the specified ContentLength. at System.Net.WebConnectionStream.CheckWriteOverflow (Int64 contentLength, Int64 totalWritten, Int64 size) [0x00000] in :0 at System.Net.WebConnectionStream.BeginWrite (System.Byte[] buffer, Int32 offset, Int32 size, System.AsyncCallback cb, System.Object state) [0x00000] in :0 at System.Net.WebConnectionStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in :0 at ForTheCommonGood.MorebitsDotNet+<>c__DisplayClass9.<PostApi>b__6 (IAsyncResult innerResult) [0x00000] in :0 at System.Net.WebAsyncResult.CB (System.Object unused) [0x00000] in :0

Unhandled Exception: System.Net.Sockets.SocketException: The descriptor is not a socket at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, Int32 offset, Int32 size, SocketFlags flags) [0x00000] in :0 at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue, Boolean allowIdle) [0x00000] in :0 at System.Windows.Forms.XplatUIX11.UpdateMessageQueue (System.Windows.Forms.XEventQueue queue) [0x00000] in :0 at System.Windows.Forms.XplatUIX11.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr handle, Int32 wFilterMin, Int32 wFilterMax) [0x00000] in :0 at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id, System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax) [0x00000] in :0 at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] in :0 at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] in :0 at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] in :0 at ForTheCommonGood.Program.Main [0x00000] in :0