Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Mono on Windows

Tags:

c#

windows

mono

I know it sounds stupid but:

I've found this application written on Mono and it is open source.

While peeking at the source code I've found this two "using" directive that stoped me:

using Gdk;

using Mono.Unix;

I guess they're Mono specific libraries.

So, it is possible to run Mono under Windows? ( perhaps Visual Studio express edition ? )

I'm trying to learn C#

I see there is a Windows branch of the app, but it is empty.

BTW: Is it Mono thought for cross platform in first place?

EDIT

I've downloaded/installed and run the sample code

using Mono.Unix;

class X { static void Main () { System.Console.Write("OK");} } 

And the answer to my own question is:

x.cs(1,12): error CS0234: The type or namespace name `Unix' does not exist 
in the namespace `Mono'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings

No, it doesn't work :(

like image 949
John Avatar asked May 07 '09 20:05

John


3 Answers

Mono on windows guide

I am not sure you will be able to use code using the Mono.Unix namespace, but generally if you are creating cross platform code, you shouldn't have to.

Gnome Do linux port. For a learning project however, I might suggest starting with code that is actually cross platform, or develop on Linux for now. Tackling cross platform issues and possibly an incomplete port will just complicate the learning process.

So, I suppose in summary to your initial question. Yes, you can run Mono on Windows, but it is possible to write platform specific code, which the example application you have chosen has indeed done. The link I provided above is a port to make that code work on Windows. Without porting ( changing the platform specific code ), that program will not compile on windows.

like image 159
Serapth Avatar answered Sep 21 '22 10:09

Serapth


Yes, you can install mono under windows. There is an experimental installer.

See: http://mono-project.com/Mono:Windows

That page also has information on the gtk libs.

like image 22
cyberconte Avatar answered Sep 20 '22 10:09

cyberconte


Of course you can run mono under windows:

http://www.go-mono.com/mono-downloads/download.html

like image 38
Blake Pettersson Avatar answered Sep 24 '22 10:09

Blake Pettersson