.NET Programming

Discussion in 'Mac Programming' started by NewbieNerd, Nov 29, 2005.

  1. macrumors 6502a

    NewbieNerd

    Joined:
    Sep 22, 2005
    Location:
    Chicago, IL
    #1
    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.
     
  2. macrumors 6502a

    jalagl

    Joined:
    Jun 5, 2003
    Location:
    Costa Rica
    #2
    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.
     
  3. macrumors 6502a

    MacCoaster

    Joined:
    Jul 15, 2002
    Location:
    Washington, DC / Rochester, NY / Lexington, NC
    #3
    GTK#, Qt# both work as toolkits, however only under X11.

    There is Cocoa#, but not complete. It's workable, though.
     
  4. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    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 :)
     
  5. macrumors 6502a

    MacCoaster

    Joined:
    Jul 15, 2002
    Location:
    Washington, DC / Rochester, NY / Lexington, NC
    #5
    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).
     
  6. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    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 ;)
     
  7. thread starter macrumors 6502a

    NewbieNerd

    Joined:
    Sep 22, 2005
    Location:
    Chicago, IL
    #7
    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?
     
  8. macrumors 601

    Compile 'em all

    Joined:
    Apr 6, 2005
    #8
    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.
     
  9. macrumors 6502a

    MacCoaster

    Joined:
    Jul 15, 2002
    Location:
    Washington, DC / Rochester, NY / Lexington, NC
    #9
    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.
    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.
     
  10. macrumors newbie

    Joined:
    Jun 20, 2004
    #10
    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.
     
  11. macrumors 601

    Compile 'em all

    Joined:
    Apr 6, 2005
    #11
    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.

    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.
     
  12. macrumors 68000

    dernhelm

    Joined:
    May 20, 2002
    Location:
    middle earth
    #12
    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.
     
  13. macrumors 68000

    dernhelm

    Joined:
    May 20, 2002
    Location:
    middle earth
    #13
    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.
     
  14. macrumors 6502a

    MacCoaster

    Joined:
    Jul 15, 2002
    Location:
    Washington, DC / Rochester, NY / Lexington, NC
    #14
    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."
    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. Completely in C#. Very useful. Besides I can use the included free MySQL API (ByteFX.Data) for Mono to connect to MySQL without ADO.
    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.
    Eh? Seems to work fine on my Linux boxen and Macs.
    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*.
     

Share This Page