PDA

View Full Version : .NET Programming




NewbieNerd
Nov 30, 2005, 12:27 AM
Do many people have experience using Mono or something to develop .NET, namely C#, programs/applications in OS X? Supposedly support for System.Windows.Forms is increasing, but I have no idea how to use it. Can anyone help?

I have installed Mono, can compile normal commandline programs via `mcs filename.cs' and then run via `mono filename.exe.' How do compile applications that use Windows.Forms?? Thanks.



jalagl
Nov 30, 2005, 01:33 AM
Windows forms is still under development, and I think it still has a long way to go. I've played a little bit with Mono, and I can tell you that while Forms support is lacking, the ASP.NET support is pretty good. I was able to test several web apps I have developed using the included XPS web server.

You can also use GTK# to develop cross-platform GUI apps. For more information about winforms, you can check out the official page, at http://www.mono-project.com/WinForms.

One gripe I do have is that getting MonoDevelop to run on Mac OSX is a PITA - or at least was the last time I checked it out.

MacCoaster
Nov 30, 2005, 08:24 AM
GTK#, Qt# both work as toolkits, however only under X11.

There is Cocoa# (http://www.mono-project.com/CocoaSharp), but not complete. It's workable, though.

kainjow
Nov 30, 2005, 08:43 AM
The first C# I ever did was with Mono on my Mac. I made an iPod class, and then once I got my PC, transferred the code, and it worked with very little change :)

MacCoaster
Nov 30, 2005, 09:45 PM
Little change? It should work without change. It's like Java, compile-once, run-anywhere (as long as the libraries are supported under the runtime ;), but that's the case with Java as well).

kainjow
Nov 30, 2005, 09:53 PM
Well, the only thing I had to change was the filesystem... Windows doesn't have /Volumes and Mac OS X doesn't have drive letters ;)

NewbieNerd
Dec 1, 2005, 12:01 PM
Well as I understand it, the libgdiplus comes standard with the Mono installation, so shouldn't I be able to run a super-simple Windows.Forms app? Is there something else I need to do as far as installation, command line, etc?

Compile 'em all
Dec 2, 2005, 05:14 AM
Little change? It should work without change. It's like Java, compile-once, run-anywhere (as long as the libraries are supported under the runtime ;), but that's the case with Java as well).

I wouldn't use the word "everywhere" when "everywhere" just means MS
windows. Java is available for Windows, Solaris, OSX , GNU/Linux as well as
a handfull of other embedded systems.

MacCoaster
Dec 5, 2005, 02:10 AM
Well, the only thing I had to change was the filesystem... Windows doesn't have /Volumes and Mac OS X doesn't have drive letters ;)
True, but that doesn't stop you from abstracting it to a higher level to make it portable across the platforms supported by mono and Microsoft's .NET runtime.
I wouldn't use the word "everywhere" when "everywhere" just means MS
windows. Java is available for Windows, Solaris, OSX , GNU/Linux as well as
a handfull of other embedded systems.
Eh? .NET binaries work fine on my Macintosh, my Linux PC, thank you very much. I never said "everywhere." I said anywhere given the runtime is supported (mono) with the class libraries.

fuzzie
Dec 5, 2005, 04:20 AM
I wouldn't use the word "everywhere" when "everywhere" just means MS
windows. Java is available for Windows, Solaris, OSX , GNU/Linux as well as
a handfull of other embedded systems.

Assuming, of course, you're lucky enough to use a platform Sun supports. I'm running Linux/ppc on my laptop, so I'm stuffed.

Whereas Mono runs quite happily on any platform you can compile it on, thanks to being open source, and while Windows.Forms support is sort of iffy right now, I'm sure that'll get fixed. And of course the underlying technologies - the CLR and C# - are open standards, unlike Java and the JVM.

Compile 'em all
Dec 5, 2005, 05:19 AM
Assuming, of course, you're lucky enough to use a platform Sun supports. I'm running Linux/ppc on my laptop, so I'm stuffed.

Whereas Mono runs quite happily on any platform you can compile it on, thanks to being open source

Please follow along carefully:

1) Go to http://java.sun.com.
2) Click the button labelled "J2SE - Core Java Software". It's the big blue button in the middle.
3) On the next page, click "Source Licensing". It's in the links on the left-hand side of the page.
4) On the Source Licensing page, click "Download".
5) Follow the directions to download the entire J2SDK source code.

and while Windows.Forms support is sort of iffy right now, I'm sure that'll get fixed. And of course the underlying technologies - the CLR and C# - are open standards, unlike Java and the JVM.

Microsoft has gotten EMCA's stamp on C#, the CLR, and the basic
Framework, but they still control them with an iron grip. When .NET's
behaviour differs from the ECMA spec, who's right, ECMA or Microsoft? Who
gets to decide how things will evolve --- ECMA, or Microsoft? And of course
.NET is much more than what ECMA has blessed. I doubt we'll see ADO,
ASP.NET, System.Windows.Forms or a bazillion other APIs that you need to
write actually useful applications in ECMA anytime soon.

Even if you're willing to go beyond ECMA and port the Microsoft proprietary
APIs to other platforms, the fact is that System.Windows.Forms is
absolutely NOT a cross-platform GUI toolkit. The Mono guys are
implementing it by sucking in WINE! There is simply no Microsoft-blessed
cross platform GUI toolkit for .NET.

dernhelm
Dec 10, 2005, 07:27 PM
Java is write once test/tweak everywhere.

C# is write anywhere, but only run on windows. :D

I've played with winforms on the latest mono and while it works in a "proof of concept" sort of way, too much is missing to be useful. You can get some hooks into XCode so C# applications are listed in the new projects dialog. That's kind of cool and works OK, but the last time I played with it, you had to fully build the entire "packaged version" or it didn't run. Debugging was all but impossible.

dernhelm
Dec 10, 2005, 07:30 PM
The Mono guys are
implementing it by sucking in WINE! There is simply no Microsoft-blessed
cross platform GUI toolkit for .NET.

This is not really true anymore. The original winforms were being implemented using Wine, but they have since switched and are implementing them "natively". That isn't to say that I'd use C# for any cross platform development, anyway, QT in C++ is much more real tool for something like that.

MacCoaster
Dec 11, 2005, 08:38 PM
Please follow along carefully:

1) Go to http://java.sun.com.
2) Click the button labelled "J2SE - Core Java Software". It's the big blue button in the middle.
3) On the next page, click "Source Licensing". It's in the links on the left-hand side of the page.
4) On the Source Licensing page, click "Download".
5) Follow the directions to download the entire J2SDK source code.
And I'm sure Sun's willing to let you hack it to your heart's desire and redistribute it to your heart's desire? Yeah right. Not my definition of "open source."
Microsoft has gotten EMCA's stamp on C#, the CLR, and the basic
Framework, but they still control them with an iron grip. When .NET's
behaviour differs from the ECMA spec, who's right, ECMA or Microsoft? Who
gets to decide how things will evolve --- ECMA, or Microsoft? And of course
.NET is much more than what ECMA has blessed. I doubt we'll see ADO,
ASP.NET, System.Windows.Forms or a bazillion other APIs that you need to
write actually useful applications in ECMA anytime soon.
ECMA's specification is on the language itself and the core libraries. .NET matches the specification's behaviour. No reason for Microsoft to deviate, for the same non-reason Sun wouldn't deviate from the Java specification. And oh, guess what, everything that was standardised with ECMA was eventually also standardised with ISO. It's very much a standard like ISO C++.

I need ADO, ASP.NET, SWF to make useful applications? Really? I didn't know that. Lemme go check back on my C# projects. I don't use ASP.NET, SWF. I use GTK# or make my own libraries to support my own programs, as I would with Microsoft.NET or Java. There are plenty of useful C# apps that don't use Microsoft's proprietary stuff. Check out Beagle (http://www.beagle-project.org/Main_Page). Completely in C#. Very useful. Besides I can use the included free MySQL API (ByteFX.Data) for Mono to connect to MySQL without ADO.
Even if you're willing to go beyond ECMA and port the Microsoft proprietary APIs to other platforms, the fact is that System.Windows.Forms is absolutely NOT a cross-platform GUI toolkit. The Mono guys are implementing it by sucking in WINE! There is simply no Microsoft-blessed cross platform GUI toolkit for .NET.
Like the other guy pointed out, Mono doesn't use Wine anymore. And no **** SWF isn't a cross-platform GUI toolkit. Who said that? However, GTK#, QT# *ARE* cross-platform as they work fine on Mac OS X and Windows.
C# is write anywhere, but only run on windows.
Eh? Seems to work fine on my Linux boxen and Macs.
I've played with winforms on the latest mono and while it works in a "proof of concept" sort of way, too much is missing to be useful. You can get some hooks into XCode so C# applications are listed in the new projects dialog. That's kind of cool and works OK, but the last time I played with it, you had to fully build the entire "packaged version" or it didn't run. Debugging was all but impossible.
Huh? If it's just a CLI app, then it's just mono someprogramexe. If it's GTK# app, just use MonoDevelop. Debugging isn't a problem. Even for Cocoa apps done in C#--Console.log will catch them.

Winforms isn't intended to be used as a solution to do GUI. Microsoft's throwing away Winforms anyway. It's just nice to have if it was the only way to run a certain program for some weird reason. Mono is fully functional with GTK# and even in its early stages, Cocoa# is useful.

By the way, I just tested out Cocoa#. Seems to work well for an early version! Ported CurrencyConverter to C# and it works beautifully on my Mac.

Stop ragging on C# or mono just because it's mostly a Microsoft project. Would you rag on the GNU team because they're supporting Java in a free way similar to that of mono? Choice is *GOOD*.