| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Using mono to enhance your apps

Page history last edited by louis.phil@... 14 years, 1 month ago

Mono has a few extra libraries that can be used in your .Net application. Using those libraries doesn't mean you are using Mono per say. Nonetheless,  they provide a lot of extra value.

 

We started by going over creating a GTK# application using MonoDevelop. GTK# is a graphical layout library similar to WinForm but with a different layout philosophy. We when over Stetic, a tool that takes a layout spec, written in XML, and generates code for you.

 

We then talk about Mono.Cecil, a reflection library that can be used to create a Silverlight profiler since, contrary to System.Reflection, Mono.Cecil doesn't care if your DLL uses the regular CLR or the core CLR. Using Mono.Cecil, you can inject CIL code into the DLL, namely at the entry and exit point of each method to keep a trace of execution of your app.

 

Gendarme is a tool written using Mono.Cecil that goes over your code and, based on definable rules, analyses flaws and code smells.

 

Mono has functionality that is unavailable to .Net. To execute such code, you need to run it in the Mono VM by using mono.exe. Continuations is one such functionality. With it, you can create microthreads that can stop their own execute and resume it exactly where it left off without the use of lambdas and callbacks. It is used a lot in the gaming world.

 

Moonlight was quickly mentioned as a separate beast because Mono was created to bring C# to Linux, whereas Moonlight development has the blessing of Microsoft because they want it to run on multiple platforms. Novell has a communication channel with Microsoft developers and has access to all the Silverlight unit tests.

 

We also took a quick look at the csharp REPL (Read-Eval-Print-Loop) shell, a console app that lets you write C# code, one line at a time. Every line entered is evaluated on the fly and executed. It's been mentionned that you can attach the shell to a running application and run code against that app. It can be a effective way to query data in a running application for debugging purposes. It is also a good way to observe and control small parts of your software.

 

We finished by wondering what were the advantages of using Mono:

  • Cheaper than a Windows dev stack
    • But that cost is nothing compared to the cost of programmers
  • Gives you freedom to add functionality to Mono and enhance the VM, like Linden Labs did for 2nd Life. All 2nd Life scripts are mono scripts that use continuations, which was not available initially.
  • Your apps are cross platform
    • Very useful for server technology
    • Mono runs ASP.Net and ASP.Net MVC

Comments (0)

You don't have permission to comment on this page.