PDA

Click to See Complete Forum and Search --> : VB on Linux


brad jones
Apr 3rd, 2007, 11:47 AM
I'd like to hear if anyone has any Visual Basic apps running on Linux using Mono. I'd be curious to see app screen shots, code, and info on what issues you had.

Brad!

wossname
Apr 3rd, 2007, 12:33 PM
Yeah I have. I'm preparing a tutorial anyway. I'll post it in a day or two.

sunburnt
Apr 3rd, 2007, 08:05 PM
I don't have any screen shots right now, but the biggest issue by far that I have seen is that sometimes programmers will do something in a windows-specific way when an alternative exists, usually because it's easier.

The first example that jumps to mind is dealing with file paths -- if you write some code (C#) like:


new FileStream("SomeFolder\\data.xml");
// or
path = this_path + @"\" + "data.xml";


this is going to cause a problem running under Linux, where the '/' character is used to separate directories. Appropriate code would be:


path = Path.Combine(this_path, "data.xml");
// or
path = this_path + Path.DirectorySeparatorChar + "data.xml"
// etc.


Another issue is that file names under *nix systems are case sensitive. The files 'README' 'ReadMe' and 'readme' can all coexist in the same directory. So if a programmer refers to a file as "MyFile.txt" once and "myfile.txt" later, strange behavior will occur.

litlewiki
Apr 4th, 2007, 05:10 AM
Ubuntu users should avoid the mono package from repo and instead use the Linux Installer for x86 from this page (http://mono-project.com/Downloads) .This installs the latest package from mono.

Also useful is the Mono Analyzer tool (http://www.mono-project.com/MoMA)that finds out porting issues with your project.

Applications built using gtk# on Linux require the gtksharp runtime to run under windows.

The monodevelop IDE is pretty much easy to use and easily converts VS.2003 projects to VS.2005 but the widgets were a bit buggy esp. the way they required containers to be added first.

ps:waiting anxiously for woss's tuto's. :D

tr333
Jun 12th, 2007, 04:33 AM
If you're doing .NET development on linux, try to stay away from using the System.Windows.Forms namespace. It has less support on mono and there are plenty of better alternatives, GTK# (http://www.mono-project.com/GtkSharp) coming to mind here. It's got a different style to the SWF way of creating a GUI, but that's half the fun in learning something new :)

brad jones
Jun 12th, 2007, 09:20 AM
If you're doing .NET development on linux, try to stay away from using the System.Windows.Forms namespace. It has less support on mono and there are plenty of better alternatives, GTK# (http://www.mono-project.com/GtkSharp) coming to mind here. It's got a different style to the SWF way of creating a GUI, but that's half the fun in learning something new :)


What does this do if you want to create IL that will run on both windows and linux? Wouldn't it be best to stick to .NET Framework classes if you want cross platform compatability?

wossname
Jun 12th, 2007, 12:55 PM
You can get GTK for Windows.

tr333
Jun 12th, 2007, 02:54 PM
What does this do if you want to create IL that will run on both windows and linux? Wouldn't it be best to stick to .NET Framework classes if you want cross platform compatability?
You can download GTK# for Windows (http://forge.novell.com/modules/xfmod/project/?gtks-inst4win).

EDIT: These apps aren't written in .NET, but Pidgin (http://www.pidgin.im/) and Gimp (http://www.gimp.org/) both use Gtk on their windows versions.

xxarmoxx
Aug 16th, 2007, 07:42 PM
I just installed mono on my mac, how do I create apps?

tr333
Aug 16th, 2007, 11:21 PM
I just installed mono on my mac, how do I create apps?

You might find an IDE for C# on OSX if you search google, but I never bothered to look. Compile your code for .NET1.1 with the "mcs" (C#) or "mbas" (VB) cmdline programs. Use the "gmcs" program for compiling .NET2.0 code. Then create a .app file for your program with the "macpack" utility.

Mono:OSX (http://www.mono-project.com/Mono:OSX)

tr333
Aug 16th, 2007, 11:30 PM
Mono Migration Analyzer (http://www.mono-project.com/MoMA) - A tool to help you identify issues when porting .NET apps to Mono.

Guide: Porting Winforms Applications (http://www.mono-project.com/Guide:_Porting_Winforms_Applications) - A guide on porting Winforms apps to Mono.