Saturday, May 1, 2010

C# Development in OSX Using MonoDevelop

"MonoDevelop is an IDE primarily designed for C# and other .NET languages. MonoDevelop enables developers to quickly write desktop and ASP.NET Web applications on Linux, Windows and Mac OSX. MonoDevelop makes it easy for developers to port .NET applications created with Visual Studio to Linux and to maintain a single code base for all platforms." - MonoDevelop

The OSX binary can be downloaded downloaded here. You will also  need the Mono 2.4+ GTK#  framework library.

One thing that seems to be missing  from MonoDevelop is the ability to interact with the built-in application console. If you have a line that requires input using Console.readLine(), you will get a runtime "System.ArgumentNullException" error because your application will just ignore the console input and try to run the succeeding lines. The preference for setting an external console does not seem to exist in the OSX version. I have not looked into other platforms to check if this is the prevailing trend.

In any case, in order to get past this bump, open Terminal and navigate to your project's folder executable file. In my OSX MonoDevelop installation where I have a project called TestProject this is the path:
/Users/macflores/projects/TestProject/TestProject/bin/debug 

Assuming you have successfully compiled your project, type in from the Terminal prompt:
tux:debug macflores$> mono TestProject.exe

And that's it! You're on your way to hacking in another language!

No comments: