Over a million developers have joined DZone.

Cross-platform .NET - try it!


I was using the .NET platform since its early release. Since then, I worked primarily on a Windows machine and never had much interest in switching platforms - after all, .NET was mainly developed by Windows developers for Windows developers. Then came Mono. As I tried it, I realized that it still had a long way to go, although it was moving in the right direction. I switched back to my comfort zone and continued working solely with Visual Studio.

Recently, I started working on a project that involved heavy use of networking components, specifically those relying on sockets. As I was building the server component, I realized that it would be great if the end-user could easily use the existing code many platforms. The purpose of my server application was such that it is used in households where I have no idea what operating system is used, but I wanted to cover as much audience as possible. In particular, I am interested in major distributions of Linux, Windows and Mac - all of them supporting Mono (what a coincidence).

I am already using Ubuntu on one of my work machines for experiment purposes, so I quickly got MonoDevelop up and running and ported my socket code to a new Mono C#-based project. To my surprise, I noticed that it needed zero modifications to run. With some tuning to my network settings and making sure that my laptop was active on the same subnet as all the test clients, I managed to transform my *nix laptop in a .NET socket gateway.

I realize that in my case this is a very basic step, and here is why:

  • I used only stock .NET classes
  • No third-party DLLs were involved
  • No GUI is involved at all, so I didn't have to rewrite my code for Gtk#

That being said, I am particularly intrigued as to how much effort will it take me to rewrite an existing WPF client (a part of the same network project) under Gtk#. I expect more work to be done there, but it is already clear that the investment in Mono is well worth my time for the reasons listed below.

1. The more platforms you cover - the more potential users you can get

A different platform won't necessarily mean that you will get a large number of new users. It might be a long shot, depending on the type of the product you are developing. However, chances are there will be enough people willing to experiment with your product on emerging platforms 

2. You get more experience with a new platform

Although you are still applying your existing language knowledge (C#, VB .NET, or maybe none of these), you still learn a lot about what *nix is and how stuff works around a new environment. That is going to help you a lot in the long run (read: job applications). As I am looking for summer internships, a lot of Microsoft-based software shops consider cross-platform .NET experience a big plus, so keep that in mind.

3. You learn to think cross-platform

Yep, that is a way of thinking about code in such a way that it can run no matter where you are. The larger the applications, the more trade-offs you will have to face. Sometimes, specific classes or library references will not be available  and you will either have to implement your own wrappers, or eliminate them completely for the sake of *nix/Mac/Windows compatibility.

Does it need enormous time investments? It depends, but not really. Does it need large financial investments? No. Does this require you to use MonoDevelop on Windows instead of Visual Studio? No. Does it require dramatic changes to your workflow? No. Conclusion of the day: give cross-platform .NET a shot.


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}