Try Mono.Cecil if you need System.Reflection.Emit in Windows Phone 7

As .NET compact framework never support System.Reflection.Emit, we can’t use Reflection.Emit in Windows Phone 7 development. So, it prevents us from porting the existing frameworks like Unity, Castle Dynamic Proxy, Moq and etc to Windows Phone 7 development platform. I was looking all options that helps us to use Reflection.Emit in Phone 7. The first option that I check is to port Mono code to Silverlight for Phone 7 version. The second option is to use Mono Cecil that is using in Mono Core. And the third option is to use EmitCF but I don’t see any update after beta release so I guess this project is dead already. So, I decided to give a try on Mono Cecil.

Mono Cecil supports Silverlight, Compact Framework and .NET desktop version. So, it’s very easy to make Cecil work on Phone 7. All I have to do is to create a conditional called CF in csproj file and then it will work like a charm. I submitted a patch to Mono Cecil but Jb Evain said that he doesn’t want to provide csproj officially so I will make the files downloadable here.

Download ~ cecil.zip (Please use Mono.Cecil – 2010.sln and Mono.Cecil-Phone.csproj )

What is Mono Cecil?

Cecil is a library written by Jb Evain to generate and inspect programs and libraries in the ECMA CIL format. It has full support for generics, and support some debugging symbol format.

In simple English, with Cecil, you can load existing managed assemblies, browse all the contained types, modify them on the fly and save back to the disk the modified assembly.

Today it is used by the Mono Debugger, the bug-finding and compliance checking tool Gendarme, MoMA, as well as DB4O.

Silverlight 4 – Features

Downloads

Features

  • Printing
  • RichTextArea control
  • ICommand support
  • ClipBoard Support
  • Implicit Styles
  • Drag/Drop Functionality
  • Right-click event handling
  • Mouse wheel support
  • HTML Hosting Support
  • WebCam and Microphone Support
  • Multicast Streaming
  • Output Protection
  • Offline DRM (for premium content)
  • Trusted Window Chrome
  • Local File System
  • Cross Site Network
  • Keyboard Access, Full Screen Support
  • Hardware Device Support
  • COM Automation Support in Windows

More:

SG Silverlighters, we got 3rd meetup

Hello Singapore Silverlight Developers,

We are gonna have “Singapore Silverlight User Group” 3rd meetup on April 22. Chris Ismael from Microsoft Singapore will talk about Silverlight for Windows Phone 7. Game Development and Mobile Application Development are very popular in Singapore. So, I believe that Chris’s section will be very interesting for you guys. Please come. See you there..

Date: 22nd April, 2010
Time: 7 PM – 10 PM
Location: Hackerspace

Agenda :

  • Anatomy of a WP7 app (from a Developer/Designer’s perspective) by Chris Ismael
  • WP7 and the impact to SL Developers (Discussion)

Special thanks to Chris, Justin Lee, Dewi and Alex.

Silverlight MVP Award 2010

Today, I have received MVP Award Kit from Microsoft today. I’m very happy about that. I like to say thank you so much to Microsoft, Lilian, Windy, Justin Angle, Justin Lee, Alex, Chris and everyone who are in Silverlight community.

1. MVP Award Kit – Fed Ex

2. MVP Award – Card

3. MVP Award

4. Silverlight MVP Awards 2009 and 2010

Related ~