views:

1638

answers:

4
+5  Q: 

Mono C# tutorial?

Is there any good tutorial to learn C# with mono? So far, google hasn't been helpful because most tutorial are for Visual Studio.

I am a Java developer, so I am familiar with Object Oriented ideas.

My goal, is to be able to develop a small portable application with a SQLite backend.

Thanks

+4  A: 

Any C# tutorial will be fine for learning the language itself. After that I would recommend The Mono Handbook for learning how to use the Mono runtime.

Andrew Hare
+2  A: 

What IDE are you using? MonoDevelop? SharpDevelop? (links are to tutorials) If you are using core functionality, you could even use Visual C# Express and just use a separate mono build step.

Marc Gravell
+5  A: 

The language itself will be the same whatever tutorial you use. Really you just need to know how to compile code using Mono instead of Visual Studio. The basic command line you'll want to use is:

gmcs Foo.cs Bar.cs

with these as the most important command line options:

  • -target - whether you want to build a console app (-target:exe), a Windows Forms app (winexe), a class library (library) or a module (module)
  • -r - add a reference to another assembly (e.g. -r:Foo.dll) - most of the common assemblies should be added automatically
  • -out - specify the output filename (e.g. -out:Foo.exe)
  • /? - find out about other command line options :)

In terms of reading material, I can recommend C# 3.0 in a Nutshell as it covers the language and the core framework classes.

Jon Skeet
Now - if only there was a book that covered the non-trivial language topics of C#, but just a little bit deeper than most...
Marc Gravell
If you will use the command-line compiler for Mono, then a source of good tutorial material might be the command-line tutorials for .NET - the ones that use csc.exe and msbuild files. Just replace csc.exe with gmcs .
Cheeso
And don't forget about MonoDevelop. You don't have to use the command line directly (but it doesn't hurt to know how to work the compiler).
Bernard
+1  A: 

You may want to have a look at the example of this Mono Wiki page. It shows basic SQLite integration. C# development with Mono (and MonoDevelop) is pretty much the same as with VS. The only significant difference will be the lack of visual designer for Windows Forms UI. Instead, it's probably better if you go with a Gtk# UI, which can be created visually in MonoDevelop.

Piotr Zurek