Complete .NET Portability with Wine & Mono?

Mono is the open-source version of Microsoft’s .NET Framework. It implements most of the backend framework features, but unfortunately, falls flat on its pretty little face when attempting to display the user interface – which is what desktop apps are all about.

Wine on the other-hand, is a Linux port of (major parts of) Microsoft’s Win32 library – the core dependencies of the Windows development libraries, and more importantly, the win32 interface elements. With Wine, you can run many traditional C++ win32 executables on Linux, with certain limitations.

Mono’s biggest stumbling block is the GUI and .NET programs that use P/Invoke to call native non-managed win32 dlls – Mono is a pure .NET environment, and can’t handle them. But from the description above, that’s exactly what WINE excel at… So can’t we use WINE + Mono to make just about any .NET program run on Linux fresh out of the .NET compiler?

Unfortunately, the answer is no. Back when the Mono project was first starting out, the Mono development team considered using WINE to implement the System.Windows.Forms namespace of the .NET Framework (which is practically 100% native C++ unmanaged win32 code in .NET wrappers). But they made the right choice in deciding to not take the easy way and go that route, leaving the integrity of the Mono project intact and focusing on true cross-platform user interface libraries instead (the GTK# is now the UI Library of choice for cross-platform .NET applications).

Continue reading

Managed Pointers to Managed Objects (or Aliases for Objects) in C# and Visual Basic .NET

One of the biggest advantages of managed frameworks/platforms like Microsoft’s .NET Framework (and it’s Linux-counterpart, Mono), and Java is that you, as a developer, have a choice of not mucking around with pointers. To be totally honest, with Java you’re forced not to – in C#, it’s a choice you have to make.

There’s plenty of good reasons for not using (unsafe!!) pointers, but that’s not the issue here. The question is, what if you want something to “point” to another object, and synchronize it’s value automatically, without resorting to unsafe pointers? There’s actually a quite simple answer using just a single line of C# code.

Whereas in C++ you could write something like what appears below, in C# you’d have to declare it as unsafe, then jump through a hundred hoops to get it to properly point to a managed object:

Continue reading

Please Microsoft, Stop Holding .NET Back!

As dedicated developers, end-users, and champions of Microsoft’s .NET Framework, we’re making a final plea to Microsoft and the .NET Framework team to save .NET and make it a real multi-platform framework. Please!

Sun could (and did) do it with Java, so why can’t Microsoft just swallow the pill already and provide real support for the .NET Framework on all operating systems? Yes, that includes Linux and Mac too. It’s ironic, because the .NET Framework has so much potential as a platform with its unique multi-language structure, nifty features, excellent libraries, (relatively) well-performing output, and darn-good innovative technologies like LINQ coming-up and XAML already here. Yet Microsoft just doesn’t realize that if they truly want .NET to succeed, they’ll have to bite the bullet and stop pretending that only officially supporting Windows won’t make users leave Linux/Mac/BSD/Whatever and buy licenses for Windows instead.

Continue reading

“People Hate Making Desktop Apps…” Since When!?

What a crazy day for technology. It all started with Paul Graham’s ridiculous link-bait article “Microsoft is Dead,” earlier today. Since then, the web has been in an uproar – just how do you define success, innovation, power, creativity, and can companies just “die” anyway? Never mind that conversation – Paul Graham surprised us there though. He’s normally a sane and very much down-to-earth person with a lot of insight on Web 2.0 and what it takes to be a startup. But that’s not what we’ve taken up a problem with – what’s really gotten to us is how some people are using his article as grounds for an argument that Desktop apps are old, dead, and a pain-in-the-ass to make.

The particular post being referred to is Ryan Stewart’s “Why Do People Hate to Build Desktop Apps?” It comes in response to the article by Don Dodge and a conversation with Simon Bateman. Now that the background’s succinctly (hopefully) out of the way: While Ryan’s article makes a valid a point about the ease-of-use of Microsoft’s .NET Framework and Adobe’s Apollo and just how powerful-yet-easy these two technologies make desktop software development – his entire article is based on an invalid premise! People don’t hate making desktop apps!

Continue reading

Image Lists or Resources?

One of the nicest things about Visual Studio and the .NET language is choice. You have plenty of choices, plenty of options, and plenty of different ways to confuse and confound yourself. Take, for instance, icons/images as “labels” for buttons: what’s the best way to do that?

At face value, there are two options, either of which should theoretically work just fine, and get what you need: Image Lists and Resources (resx files). Technically, there’s even a third option: compiling local resources directly into your application. Anyway if this all sounds like Greek to you, no worries, here’s the low-down on these two (three) different ways of adding an image to your file.

Continue reading