Experimental Support for Mono in PostSharp 1.1

by Gael Fraiteur on 07 Oct 2007

If you use Mono to run your .NET applications on other platforms, this is likely to interest you: PostSharp 1.1 will include experimental support for Mono. You can already download a first snapshot today!

It has been a hard week of work but now the first bits are working: PostSharp now runs on Mono!

Look at PostSharp Explorer, a Reflector-like sample based on PostSharp, running in openSuse 10.2:

A new NAnt task has been developed, since XBuild is still not yet sufficiently functional.

You can download Mono-enabled PostSharp from our daily builds section! Download the source package, unzip it, go to the directory Core/PostSharp.NAntTasks and type nant, and you can start!

Gentlemen, porting such an application to Mono is a real pain, and there is still a lot of work to fix issues, so I would appreciate your feedback on this question: Does it worth the effort? Does anyone use Mono and would use PostSharp together? I have no other mean than your feedback to evaluate the user base of PostSharp under Mono.

Here are the limitations you should be aware of:

  • In order to use PostSharp under Mono, you should compile it for Mono (using nant, not msbuild). Do not try to use Windows binaries under Mono! Conversely, using Mono binaries under Windows should work, but you will have a degraded experience.
  • There is no support for debugging symbols.
  • Binding with System.Reflection has some problems as far as generics are concerned, probably due to subtle differences between Mono and .NET.
  • If you post-compile an assembly under Windows using Laos, it will maybe not work under Mono, and conversely (because of differing implementation of MethodBase.ToString, on which PostSharp currently relies).
  • There seems to be problems in the Mono runtime with some instructions like ldtoken with generics.

So it you don't mix generics with PostSharp, it should work correctly. For generics, I will try to find some cooperation from Novell guys to diagnose and fix the bugs.

Note that I suppose PostSharp will not read assemblies on big-endian machines, which would not a bug or 'feature' of Mono but one of PostSharp :-).

Enjoy!