[Mono-winforms-list] Converting a Visual C# Application to Linux with MonoDevelop

Bankai richard.havinga at live.co.uk
Wed Nov 19 15:35:13 EST 2008


Hi,
I have attached some prototype files for the project in which i intend to
undertake to understand a little more about how Linux Works. I am completely
new to Mono, so I decided to create a small app in Visual Studio 2008 which
I knew that works but I am getting several errors when building the solution
as stated below. This application runs off of a USB Pen drive called
KINGSTON at the moment which where the text file that is read and modified
is stored. 

Application Output:

Unhandled Exception: System.ArgumentOutOfRangeException: < 0
Parameter name: length
  at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/corlib/System/String.cs:363 
  at WindowsFormsApplication1.Form1.Form1_Load (System.Object sender,
System.EventArgs e) [0x00087] in
/media/KINGSTON/WindowsFormsApplication1/WindowsFormsApplication1/Form1.cs:96 
  at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00022] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2100 
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00023]
in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2879 
  at System.Windows.Forms.Form.OnCreateControl () [0x00027] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2043 
  at System.Windows.Forms.Control.CreateControl () [0x0009e] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:3731 
  at System.Windows.Forms.Control.WmShowWindow
(System.Windows.Forms.Message& m) [0x00036] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5627 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x001dc] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5219 
  at System.Windows.Forms.ScrollableControl.WndProc
(System.Windows.Forms.Message& m) [0x00000] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:797 
  at System.Windows.Forms.ContainerControl.WndProc
(System.Windows.Forms.Message& m) [0x0003d] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs:589 
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message& m)
[0x00166] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2547 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:225 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:206 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x0006a] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:188 
  at System.Windows.Forms.XplatUIX11.SendMessage (IntPtr hwnd, Msg message,
IntPtr wParam, IntPtr lParam) [0x0008d] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:4898 
  at System.Windows.Forms.XplatUIX11.MapWindow (System.Windows.Forms.Hwnd
hwnd, WindowType windows) [0x0003c] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:1435 
  at System.Windows.Forms.XplatUIX11.CreateWindow
(System.Windows.Forms.CreateParams cp) [0x00569] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:2723 
  at System.Windows.Forms.XplatUI.CreateWindow
(System.Windows.Forms.CreateParams cp) [0x00000] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:475 
  at System.Windows.Forms.NativeWindow.CreateHandle
(System.Windows.Forms.CreateParams create_params) [0x0000c] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:112 
  at System.Windows.Forms.Control.CreateHandle () [0x0003f] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4375 
  at System.Windows.Forms.Form.CreateHandle () [0x00000] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:1930 
  at System.Windows.Forms.Control.CreateControl () [0x00044] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:3711 
  at System.Windows.Forms.Control.SetVis
ibleCore (Boolean value) [0x0003e] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4923 
  at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00071] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2404 
  at System.Windows.Forms.Control.set_Visible (Boolean value) [0x0000c] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:3372 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.Control:set_Visible (bool)
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x00059] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:736 
  at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext context) [0x00014] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:635 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form
mainForm) [0x00000] in
/usr/src/packages/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:623 
  at WindowsFormsApplication1.Program.Main () [0x0000b] in
/media/KINGSTON/WindowsFormsApplication1/WindowsFormsApplication1/Program.cs:20 

Build Output: 
Build successful.
System.Xml.Linq, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 could not be found or is invalid.
System.Data.DataSetExtensions could not be found or is invalid.
System.Deployment could not be found or is invalid.


http://www.nabble.com/file/p20588704/Form1.cs Form1.cs 
http://www.nabble.com/file/p20588704/Form1.Designer.cs Form1.Designer.cs 
http://www.nabble.com/file/p20588704/WindowsFormsApplication1.sln
WindowsFormsApplication1.sln 
http://www.nabble.com/file/p20588704/WindowsFormsApplication1.suo
WindowsFormsApplication1.suo 
http://www.nabble.com/file/p20588704/Program.cs Program.cs 
http://www.nabble.com/file/p20588704/Form1.resources Form1.resources 
http://www.nabble.com/file/p20588704/Form1.resx Form1.resx 
http://www.nabble.com/file/p20588704/WindowsFormsApplication1.mds
WindowsFormsApplication1.mds 
http://www.nabble.com/file/p20588704/WindowsFormsApplication1.csproj.user
WindowsFormsApplication1.csproj.user 


I Know its possible to port across Applications from Visual Studio 2003 with
PRJ2MAKE, I have made the same file within a version of VS 2003 that I had
but the code then doesnt work for reading in the text file, but modifies it
and saves it and thats it but I am sure that is for a different forum. Any
help will be glady Appreciated. 
-- 
View this message in context: http://www.nabble.com/Converting-a-Visual-C--Application-to-Linux-with-MonoDevelop-tp20588704p20588704.html
Sent from the Mono - WinForms mailing list archive at Nabble.com.



More information about the Mono-winforms-list mailing list