CInject (or CodeInject) allows code injection into any managed assembly without disassembling and recompiling it. It eases the inevitable task of injecting any code in single or multiple methods in one or many assemblies to intercept code for almost any purpose.  When using CInject, you do not require any knowledge of the target application.  Your target application can be an application that you have developed or has been developed by someone else.

You can create your own injectors very easily and inject them in any target assembly/executable. CInject ships with few injectors that can be directly used to add logging, performance counters, retrieve runtime values of objects and their properties.

Provides runtime intelligence such as 

  • Values of arguments to the called function
  • Object life time of a method / variables called within the method
  • Allows customization of logging or diagnostics
  • Allows extension of injectors to tailor your own solution as the need be
  • Measure the method execution time to check performance

Build your own plugins using CInject information

  • CInject supports building your own plugins
  • The plugin receives information from the application such as
    • Target assembly & method
    • Injector assembly & method
    • Processing details, results with timestamp
    • Exceptions and errors
  • Customized Plugin menu in CInject application

License and Download

It is developed in C# and uses Mono.Cecil for code interception and log4net for logging purposes.  CInject uses GNU GPL v3 license and source code is checked in at CodePlex website.

Download from http://codeinject.codeplex.com/releases/
  

How to?

Code Profiling

CInject uses YourKit profiler to profile the application.
YourKit is kindly supporting open source projects with its full-featured Java/.NET Profiler.
YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: YourKit Java Profiler and YourKit .NET Profiler

 

Code Quality

CInject uses ReSharper to ensure code quality