Mono.Cecil

For the past several weeks, I’ve been working on a project I’ve entitled DBC#. At its core, DBC# is a way to createhttp://www.movabletype.org/ and automatically enforce contracts on method calls. We’ve all heard programming professors talk about the importance of specifying preconditions, postconditions, and invariants, but only Eiffel ever incorporated these into their language. With .NET attributes, I hope to change this.

I’m not going to type out a full description of what DBC# is or intends to do here. I’ve already done that on its project page.

Unfortunately, I’m at a standstill. My current approach involves taking a compiled .NET binary, searching for the DBC#-specific attributes, and inserting code into the appropriate locations. Unfortunately, no libraries exist right now that give me the granularity of access that I really need. I need to be able to see the attributes on methods and classes (specifically, I need their arguments), and I need to be able to inject code.

The Mono.Cecil library aims to do just this. Unfortunately, Jb Evain, the mastermind behind the project, isn’t finished tinkering with the public API yet. And until he feels that the project is ready, I have to just sit here and wait. Painful, eh?

I hope I can be of help to him when he’s done with the API-design portion. Unfortunately, I’m not exactly fluent in IL. Then again, maybe this is a good time to start learning, since his project is clearly a dependency of mine.